Set and handle open property on inactivity notices
This commit is contained in:
parent
3cc44bab83
commit
4adae3af51
@ -62,6 +62,16 @@ export async function onRequestPost(context: RequestContext) {
|
||||
|
||||
requestedNotice.decisions = decisions;
|
||||
|
||||
if (Object.values(decisions).length === requestedNotice.departments.length) {
|
||||
requestedNotice.open = false;
|
||||
|
||||
await context.env.D1.prepare(
|
||||
"UPDATE inactivity_notices SET open = 0 WHERE id = ?;",
|
||||
)
|
||||
.bind(context.params.id)
|
||||
.run();
|
||||
}
|
||||
|
||||
await context.env.DATA.put(
|
||||
`inactivity_${context.params.id as string}`,
|
||||
JSON.stringify(requestedNotice),
|
||||
|
@ -24,6 +24,7 @@ export async function onRequestPost(context: RequestContext) {
|
||||
created_at: Date.now(),
|
||||
departments,
|
||||
end,
|
||||
open: true,
|
||||
reason,
|
||||
start,
|
||||
user: {
|
||||
|
Loading…
x
Reference in New Issue
Block a user