From 26840ab098b45b94ecdb7db6b6a28b763326207f Mon Sep 17 00:00:00 2001 From: Drew Ansbacher Date: Tue, 14 Sep 2021 10:47:25 -0600 Subject: [PATCH] delete all endpoint update --- ui/src/app/pages/notifications/notifications.page.ts | 4 ++-- ui/src/app/services/api/api.types.ts | 4 ++-- ui/src/app/services/api/embassy-live-api.service.ts | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ui/src/app/pages/notifications/notifications.page.ts b/ui/src/app/pages/notifications/notifications.page.ts index dd8d86149..dac0f16b6 100644 --- a/ui/src/app/pages/notifications/notifications.page.ts +++ b/ui/src/app/pages/notifications/notifications.page.ts @@ -57,7 +57,7 @@ export class NotificationsPage { } } - async delete (id: string, index: number): Promise { + async delete (id: number, index: number): Promise { const loader = await this.loadingCtrl.create({ spinner: 'lines', message: 'Deleting...', @@ -85,7 +85,7 @@ export class NotificationsPage { await loader.present() try { - await this.embassyApi.deleteAllNotifications({ }) + await this.embassyApi.deleteAllNotifications({ before: this.notifications[0].id }) this.notifications = [] this.beforeCursor = undefined } catch (e) { diff --git a/ui/src/app/services/api/api.types.ts b/ui/src/app/services/api/api.types.ts index 81eff7141..a68b8d5de 100644 --- a/ui/src/app/services/api/api.types.ts +++ b/ui/src/app/services/api/api.types.ts @@ -71,10 +71,10 @@ export module RR { export type GetNotificationsReq = WithExpire<{ before?: number, after?: number, limit?: number }> // notification.list export type GetNotificationsRes = WithRevision[]> - export type DeleteNotificationReq = { id: string } // notification.delete + export type DeleteNotificationReq = { id: number } // notification.delete export type DeleteNotificationRes = null - export type DeleteAllNotificationsReq = { } // notification.delete.all + export type DeleteAllNotificationsReq = { before: number } // notification.delete.all export type DeleteAllNotificationsRes = null // wifi diff --git a/ui/src/app/services/api/embassy-live-api.service.ts b/ui/src/app/services/api/embassy-live-api.service.ts index 07d7fb113..f618e5d36 100644 --- a/ui/src/app/services/api/embassy-live-api.service.ts +++ b/ui/src/app/services/api/embassy-live-api.service.ts @@ -143,7 +143,7 @@ export class LiveApiService extends ApiService { } async deleteAllNotifications (params: RR.DeleteAllNotificationsReq): Promise { - return this.http.rpcRequest({ method: 'notification.delete.all', params }) + return this.http.rpcRequest({ method: 'notification.delete-before', params }) } // wifi