update api

This commit is contained in:
prafull-opensignlabs
2024-01-12 13:24:41 +05:30
parent 89ba3e0fa4
commit a8d564d74d
3 changed files with 14 additions and 12 deletions
@@ -15,6 +15,7 @@ import getTemplate from './routes/getTemplate.js';
import deletedTemplate from './routes/deleteTemplate.js';
import getTemplatetList from './routes/getTemplateList.js';
import updateTemplate from './routes/updateTemplate.js';
import createContact from './routes/createContact.js';
dotenv.config();
app.use(cors());
@@ -24,11 +25,8 @@ app.use(express.urlencoded({ limit: '50mb', extended: true }));
// get user details whose api token used
app.get('/getuser', getUser);
// get all types of documents on the basis of doctype
app.get('/documentlist', getDocumentList);
// get Document on the basis of id
app.get('/document/:document_id', getDocument);
// get contact on the basis of id
app.post('/createcontact', createContact);
// get contact on the basis of id
app.get('/contact/:contact_id', getContact);
@@ -37,11 +35,17 @@ app.get('/contact/:contact_id', getContact);
app.delete('/contact/:contact_id', deleteContact);
// get list of contacts
app.get('/contactlist', getContactList);
app.post('/contactlist', getContactList);
// create Document
app.post('/createdocument', createDocument);
// get Document on the basis of id
app.get('/document/:document_id', getDocument);
// get all types of documents on the basis of doctype
app.post('/documentlist', getDocumentList);
// create Template
app.post('/createtemplate', createTemplate);
@@ -55,4 +59,4 @@ app.put('/template/:template_id', updateTemplate);
app.delete('/template/:template_id', deletedTemplate);
// get all types of documents on the basis of doctype
app.get('/templatelist', getTemplatetList);
app.post('/templatelist', getTemplatetList);
@@ -25,7 +25,7 @@ export default async function getContact(request, response) {
result: { objectId: parseRes.objectId, Name: parseRes.Name, Email: parseRes.Email },
});
} else {
return response.json({ code: 404, message: 'Record not found!' });
return response.json({ code: 404, message: 'Contact not found!' });
}
} else {
return response.json({ code: 405, message: 'Invalid API Token!' });
+2 -4
View File
@@ -40,10 +40,8 @@ Parse.Cloud.define('getDrive', getDrive);
Parse.Cloud.define('getReport', getReport);
Parse.Cloud.define('generateapitoken', generateApiToken);
Parse.Cloud.define('getapitoken', getapitoken);
Parse.Cloud.define('getDrive', getDrive)
Parse.Cloud.define('getReport', getReport)
Parse.Cloud.define("getTemplate", GetTemplate)
Parse.Cloud.define('getTemplate', GetTemplate);
Parse.Cloud.afterSave('contracts_Document', DocumentAftersave);
Parse.Cloud.afterSave('contracts_Contactbook', ContactbookAftersave);
Parse.Cloud.afterSave('contracts_Users', ContractUsersAftersave);
Parse.Cloud.afterSave("contracts_Template", TemplateAfterSave)
Parse.Cloud.afterSave('contracts_Template', TemplateAfterSave);