better code: clearer api name

Massimo Melina committed Jun 19, 2023 at 12:03 UTC 5e17364fb54e7188e1972a7e4885c9c6555db2db
3 files changed +3 -3
frontend/src/fileMenu.ts
+1 -1
@@ -68,7 +68,7 @@ export function openFileMenu(entry: DirEntry, ev: MouseEvent, addToMenu: (FileMe
68 ),
69 entry.cantOpen && h(Fragment, {}, hIcon('password', { style: { marginRight: '.5em' } }), t(MISSING_PERM)),
70 h('div', { className: 'file-menu' },
71 - dontBotherWithKeys(menu.map((e: any, i) =>
71 + dontBotherWithKeys(menu.map((e: any, i) => // render menu entries
72 isValidElement(e) ? e
73 : !e?.label ? null :
74 h('a', {
frontend/src/menu.ts
+1 -1
@@ -207,7 +207,7 @@ export async function deleteFiles(uris: string[], root: string='') {
207 if (!await confirmDialog(t('delete_confirm', {n}, "Delete {n,plural, one{# item} other{# items}}?")))
208 return false
209 const errors = onlyTruthy(await Promise.all(uris.map(uri =>
210 - apiCall('del', { uri: root + uri }).then(() => null, err => ({ uri, err }))
210 + apiCall('delete', { uri: root + uri }).then(() => null, err => ({ uri, err }))
211 )))
212 reloadList()
213 const e = errors.length
src/frontEndApis.ts
+1 -1
@@ -54,7 +54,7 @@ export const frontEndApis: ApiHandlers = {
54 }
55 },
56
57 - async del({ uri }, ctx) {
57 + async delete({ uri }, ctx) {
58 apiAssertTypes({ string: { uri } })
59 const node = await urlToNode(uri, ctx)
60 if (!node)