feat: add update template api and update all apis

This commit is contained in:
prafull-opensignlabs
2024-01-11 22:19:40 +05:30
parent ea9b0370c4
commit eebcfe94d9
14 changed files with 124 additions and 26 deletions
@@ -70,9 +70,13 @@ export default async function createContact(request, response) {
contactQuery.setACL(acl);
await contactQuery.save();
const contactRes = await contactQuery.save();
// const parseData = JSON.parse(JSON.stringify(res));
return response.json({ code: 200, message: 'Contact create sucessfully!' });
return response.json({
code: 200,
message: 'Contact created sucessfully!',
result: { id: contactRes.id },
});
}
} catch (err) {
console.log('err ', err);
@@ -106,8 +110,12 @@ export default async function createContact(request, response) {
acl.setWriteAccess(userRes.id, true);
contactQuery.setACL(acl);
await contactQuery.save();
return response.json({ code: 200, message: 'Contact create sucessfully!' });
const contactRes = await contactQuery.save();
return response.json({
code: 200,
message: 'Contact created sucessfully!',
result: { id: contactRes.id },
});
// const parseData = JSON.parse(JSON.stringify(res));
}
}
@@ -115,6 +123,6 @@ export default async function createContact(request, response) {
return response.json({ code: 404, message: 'Something went wrong, please try again later!' });
}
} else {
return response.json({ code: 404, message: 'Invalid API Token!' });
return response.json({ code: 405, message: 'Invalid API Token!' });
}
}