Skip to content
Snippets Groups Projects
Commit 28a30946 authored by Damyan Mitev's avatar Damyan Mitev :beach:
Browse files

add error handling to documentCreateDocument and documentPutDocument

parent c86529e3
No related branches found
No related tags found
1 merge request!48269 implement workflow for signing already uploaded document dev
......@@ -1056,6 +1056,10 @@ const connection = Penpal.connectToParent({
const response = await executeRestfulFunction("private", window.viamApi, window.viamApi.documentCreateDocument,
config);
if (response.code !== "200") {
return encodeResponse("400", "", response.status);
}
return encodeResponse("200", response.data, "Document created");
},
documentPutDocument: async (passportUUID, resourceid, contentType, file) => {
......@@ -1080,6 +1084,10 @@ const connection = Penpal.connectToParent({
const response = await executeRestfulFunction(
"private", window.viamApi, window.viamApi.documentPutDocument, config, file);
if (response.code !== "200") {
return encodeResponse("400", "", response.status);
}
return encodeResponse("200", response.data, "Document stored");
},
hasSession() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment