Skip to content

Commit 2212683

Browse files
fix(zim): adicionar método deleteZimFile ausente no API client
O Content Manager chamava api.deleteZimFile() para deletar arquivos ZIM, mas esse método nunca foi implementado na classe API, causando "TypeError: deleteZimFile is not a function". O backend (DELETE /api/zim/:filename → ZimController.delete) já existia e funcionava corretamente — só faltava o método no client frontend que faz a ponte. Closes #372
1 parent 1ce4347 commit 2212683

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

admin/inertia/lib/api.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -518,6 +518,13 @@ class API {
518518
})()
519519
}
520520

521+
async deleteZimFile(filename: string) {
522+
return catchInternal(async () => {
523+
const response = await this.client.delete<{ message: string }>(`/zim/${filename}`)
524+
return response.data
525+
})()
526+
}
527+
521528
async listZimFiles() {
522529
return catchInternal(async () => {
523530
return await this.client.get<ListZimFilesResponse>('/zim/list')

0 commit comments

Comments
 (0)