-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7870167
commit c2bbb73
Showing
14 changed files
with
214 additions
and
243 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,17 +16,16 @@ function mapMessageObjectForFront(data) { | |
|
||
function mapAssistanceRequestObjectForBack(data) { | ||
let assistanceRequest = new MappableObjectForBack(data, AssistanceRequestMappings).toJSON() | ||
if (assistanceRequest['ofm_contact_method'] == '1') | ||
delete assistanceRequest['ofm_telephone'] | ||
if (assistanceRequest['ofm_contact_method'] == '1') delete assistanceRequest['ofm_telephone'] | ||
assistanceRequest['[email protected]'] = `/ofm_request_categories(${data?.requestCategoryId})` | ||
assistanceRequest['[email protected]'] = `/contacts(${data?.contactId})` | ||
assistanceRequest['ofm_facility_request_request'] = []; | ||
data?.facilities?.forEach(facility => { | ||
assistanceRequest['ofm_facility_request_request'] = [] | ||
data?.facilities?.forEach((facility) => { | ||
assistanceRequest['ofm_facility_request_request'].push({ | ||
'[email protected]' : `/accounts(${facility.facilityId})`, | ||
'[email protected]': `/accounts(${facility.facilityId})`, | ||
}) | ||
}) | ||
return assistanceRequest; | ||
return assistanceRequest | ||
} | ||
|
||
function sortByPropertyDesc(property) { | ||
|
@@ -67,7 +66,7 @@ async function updateMessageLastOpenedTime(req, res) { | |
let response = await patchOperationWithObjectId('emails', req.params.messageId, req.body) | ||
return res.status(HttpStatus.OK).json(response) | ||
} catch (e) { | ||
return res.status(HttpStatus.INTERNAL_SERVER_ERROR).json(e.data? e.data : e?.status ) | ||
return res.status(HttpStatus.INTERNAL_SERVER_ERROR).json(e.data ? e.data : e?.status) | ||
} | ||
} | ||
|
||
|
@@ -78,13 +77,12 @@ async function createNewAssistanceRequest(req, res) { | |
response = new MappableObjectForFront(response, AssistanceRequestMappings).toJSON() | ||
return res.status(HttpStatus.OK).json(response) | ||
} catch (e) { | ||
return res.status(HttpStatus.INTERNAL_SERVER_ERROR).json(e.data? e.data : e?.status ) | ||
return res.status(HttpStatus.INTERNAL_SERVER_ERROR).json(e.data ? e.data : e?.status) | ||
} | ||
} | ||
|
||
module.exports = { | ||
getMessages, | ||
updateMessageLastOpenedTime, | ||
createNewAssistanceRequest, | ||
}; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.