delete recovered

This commit is contained in:
Drew Ansbacher
2021-10-11 12:52:43 -06:00
committed by Aiden McClelland
parent 7dcb4239df
commit 71ce2b064f
6 changed files with 69 additions and 25 deletions

View File

@@ -478,26 +478,32 @@ export class MockApiService extends ApiService {
},
]
let res: any
try {
res = await this.http.rpcRequest<WithRevision<null>>({ method: 'db.patch', params: { patch } })
setTimeout(async () => {
const patch = [
{
op: PatchOp.REMOVE,
path: `/package-data/${params.id}`,
},
]
this.http.rpcRequest<WithRevision<null>>({ method: 'db.patch', params: { patch } })
}, this.revertTime)
} catch (e) {
res = await this.http.rpcRequest<WithRevision<null>>({ method: 'db.patch', params: { patch } })
setTimeout(async () => {
const patch = [
{
op: PatchOp.REMOVE,
path: `/recovered-packages/${params.id}`,
path: `/package-data/${params.id}`,
},
]
res = await this.http.rpcRequest<WithRevision<null>>({ method: 'db.patch', params: { patch } })
}
this.http.rpcRequest<WithRevision<null>>({ method: 'db.patch', params: { patch } })
}, this.revertTime)
return res
}
async deleteRecoveredPackageRaw (params: RR.DeleteRecoveredPackageReq): Promise<RR.DeleteAllNotificationsRes> {
await pauseFor(2000)
let res: any
const patch = [
{
op: PatchOp.REMOVE,
path: `/recovered-packages/${params.id}`,
},
]
res = await this.http.rpcRequest<WithRevision<null>>({ method: 'db.patch', params: { patch } })
return res
}