delete account export after download

main
alex 2024-03-31 14:26:04 +02:00
parent ec0eb9d35d
commit b0eface1f8
1 changed files with 9 additions and 1 deletions

View File

@ -1217,7 +1217,7 @@ export async function GetExportedUserAccount(req: Request, res: Response) {
"GetExportedUserAccount error",
"invalid request (user account export not found)"
);
return res.status(400).send({ err: "invalid request" });
return res.redirect("/");
}
if (
@ -1299,6 +1299,14 @@ export async function GetExportedUserAccount(req: Request, res: Response) {
});
}
});
// delete expired user account export
await UserAccountExport.destroy({
where: {
export_id: id,
},
});
} catch (error) {
logger.error("get exported user account error", error as string);
res.status(500).send({ err: "invalid request" });