feat: allow specify if notification is success or error
This commit is contained in:
parent
386c18a1bc
commit
f5b5f3751e
1 changed files with 15 additions and 5 deletions
|
|
@ -473,11 +473,21 @@ export class BackupController extends Controller {
|
||||||
|
|
||||||
@Post("notify")
|
@Post("notify")
|
||||||
async notifyBackup(
|
async notifyBackup(
|
||||||
@Body() payload: { message: string; userId?: string | string[]; roles?: string | string[] },
|
@Body()
|
||||||
|
payload: {
|
||||||
|
message: string;
|
||||||
|
userId?: string | string[];
|
||||||
|
roles?: string | string[];
|
||||||
|
error?: boolean;
|
||||||
|
},
|
||||||
) {
|
) {
|
||||||
sendWebSocket("backup-notification", payload.message, {
|
sendWebSocket(
|
||||||
roles: payload.roles || [],
|
"backup-notification",
|
||||||
userId: payload.userId || [],
|
{ success: !payload.error, message: payload.message },
|
||||||
});
|
{
|
||||||
|
roles: payload.roles || [],
|
||||||
|
userId: payload.userId || [],
|
||||||
|
},
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue