Fix object-stringifying of things that shouldn't be stringified
This commit is contained in:
@@ -25,6 +25,11 @@ export async function onRequestGet(context: RequestContext) {
|
|||||||
if (!data || data.user?.id !== context.data.current_user.id)
|
if (!data || data.user?.id !== context.data.current_user.id)
|
||||||
return jsonError("Item does not exist", 404);
|
return jsonError("Item does not exist", 404);
|
||||||
|
|
||||||
|
if (type === "inactivity") {
|
||||||
|
data.decisions = JSON.parse(data.decisions);
|
||||||
|
data.departments = JSON.parse(data.departments);
|
||||||
|
}
|
||||||
|
|
||||||
if (type === "report") {
|
if (type === "report") {
|
||||||
data.attachments = JSON.parse(data.attachments);
|
data.attachments = JSON.parse(data.attachments);
|
||||||
data.target_ids = JSON.parse(data.target_ids);
|
data.target_ids = JSON.parse(data.target_ids);
|
||||||
|
|||||||
Reference in New Issue
Block a user