mirror of
https://github.com/OpenSignLabs/OpenSign.git
synced 2026-08-17 21:25:54 +02:00
change body parameter of update API
This commit is contained in:
@@ -26,20 +26,20 @@ export default async function updateDocument(request, response) {
|
||||
const document = Parse.Object.extend('contracts_Document');
|
||||
const updateQuery = new document();
|
||||
updateQuery.id = request.params.document_id;
|
||||
if (request?.body?.Name) {
|
||||
updateQuery.set('Name', request?.body?.Name);
|
||||
if (request?.body?.name) {
|
||||
updateQuery.set('Name', request?.body?.name);
|
||||
}
|
||||
if (request?.body?.Note) {
|
||||
updateQuery.set('Note', request?.body?.Note);
|
||||
if (request?.body?.note) {
|
||||
updateQuery.set('Note', request?.body?.note);
|
||||
}
|
||||
if (request?.body?.Description) {
|
||||
updateQuery.set('Name', request?.body?.Description);
|
||||
if (request?.body?.description) {
|
||||
updateQuery.set('Name', request?.body?.description);
|
||||
}
|
||||
if (request?.body?.FolderId) {
|
||||
if (request?.body?.folderId) {
|
||||
updateQuery.set('Folder', {
|
||||
__type: 'Pointer',
|
||||
className: 'contracts_Document',
|
||||
objectId: request?.body?.FolderId,
|
||||
objectId: request?.body?.folderId,
|
||||
});
|
||||
}
|
||||
const updatedRes = await updateQuery.save(null, { useMasterKey: true });
|
||||
|
||||
@@ -26,20 +26,20 @@ export default async function updateTemplate(request, response) {
|
||||
const template = Parse.Object.extend('contracts_Template');
|
||||
const updateQuery = new template();
|
||||
updateQuery.id = request.params.template_id;
|
||||
if (request?.body?.Name) {
|
||||
updateQuery.set('Name', request?.body?.Name);
|
||||
if (request?.body?.name) {
|
||||
updateQuery.set('Name', request?.body?.name);
|
||||
}
|
||||
if (request?.body?.Note) {
|
||||
updateQuery.set('Note', request?.body?.Note);
|
||||
if (request?.body?.note) {
|
||||
updateQuery.set('Note', request?.body?.note);
|
||||
}
|
||||
if (request?.body?.Description) {
|
||||
updateQuery.set('Name', request?.body?.Description);
|
||||
if (request?.body?.description) {
|
||||
updateQuery.set('Name', request?.body?.description);
|
||||
}
|
||||
if (request?.body?.FolderId) {
|
||||
if (request?.body?.folderId) {
|
||||
updateQuery.set('Folder', {
|
||||
__type: 'Pointer',
|
||||
className: 'contracts_Template',
|
||||
objectId: request?.body?.FolderId,
|
||||
objectId: request?.body?.folderId,
|
||||
});
|
||||
}
|
||||
const updatedRes = await updateQuery.save(null, { useMasterKey: true });
|
||||
|
||||
Reference in New Issue
Block a user