mirror of
https://github.com/OpenSignLabs/OpenSign.git
synced 2026-08-21 07:02:32 +02:00
add template report and form , as well as migration code for it
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import axios from 'axios';
|
||||
|
||||
export default async function GetTemplate(request) {
|
||||
const serverUrl = process.env.SERVER_URL;
|
||||
const templateId = request.params.templateId;
|
||||
@@ -10,6 +12,8 @@ export default async function GetTemplate(request) {
|
||||
},
|
||||
});
|
||||
const userId = userRes.data && userRes.data.objectId;
|
||||
console.log("templateId ", templateId)
|
||||
console.log("userId ",userId)
|
||||
if (templateId && userId) {
|
||||
try {
|
||||
const template = new Parse.Query('contracts_Template');
|
||||
@@ -17,9 +21,12 @@ export default async function GetTemplate(request) {
|
||||
template.include('ExtUserPtr');
|
||||
template.include('Signers');
|
||||
template.include('CreateBy');
|
||||
const res = template.first({ useMasterKey: true });
|
||||
const res = await template.first({ useMasterKey: true });
|
||||
console.log("res ", res)
|
||||
if (res) {
|
||||
console.log("res ",res)
|
||||
const acl = res.getACL();
|
||||
console.log("acl", acl.getReadAccess(userId))
|
||||
if (acl && acl.getReadAccess(userId)) {
|
||||
return res;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user