Skip to content

Commit 50fc6ed

Browse files
authored
Merge pull request #338 from scientist-softserv/337-api-changes
337 api changes
2 parents 0002bf7 + f808805 commit 50fc6ed

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

pages/requests/[uuid].js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ const Request = ({ session }) => {
7070
if (session === null) return unauthorizedUser
7171

7272
const isLoading = isLoadingRequest || isLoadingSOWs || isLoadingFiles || isLoadingMessages
73-
const isError = isRequestError || isSOWError || isFilesError|| isMessagesError || isPOError
73+
const isError = isRequestError || isSOWError || isFilesError || isMessagesError || isPOError
7474
const documents = (allSOWs) ? [...allSOWs, ...allPOs] : []
7575

7676
if (isLoading) return pageLoading

utils/api/configurations.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ export const configureMessages = (data) => {
172172
}))
173173
}
174174

175-
export const configureFiles = (data) => {
175+
export const configureFiles = (data) => {
176176
// filter out the notes that do not have attachments
177177
const notesWithFiles = data.filter(d => d.attachments?.length)
178178
let fileArrays = []
@@ -235,7 +235,7 @@ export const configurePO = (po, requestIdentifier) => ({
235235
...configureDocument(po, requestIdentifier),
236236
turnaroundTime: po.turn_around_time.human,
237237
poNumber: po.po_number,
238-
relatedSOWIdentifier: po.proposal_ref?.identifier,
238+
relatedSOWIdentifier: po.proposal_refs.first?.identifier,
239239
adPO: po.scientist_identifier,
240240
})
241241

utils/api/requests.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ export const getAllPOs = async (quotedWareId, uuid, requestIdentifier, accessTok
6565
const url = () => accessToken ? `quote_groups/${uuid}/quoted_wares/${quotedWareId}/purchase_orders.json` : null
6666
const data = await fetcher(url(), accessToken)
6767
const configuredPOs = data?.purchase_orders.map(async (po) => {
68-
const purchaseOrder = await fetcher(`quote_groups/${uuid}/quoted_wares/${quotedWareId}/purchase_orders/${po.id}.json`, accessToken)
69-
return configurePO(purchaseOrder, requestIdentifier)
68+
const res = await fetcher(`quote_groups/${uuid}/quoted_wares/${quotedWareId}/purchase_orders/${po.id}.json`, accessToken)
69+
return configurePO(res.purchase_order, requestIdentifier)
7070
})
7171
const allPOs = await Promise.all(configuredPOs).then(res => res)
7272

0 commit comments

Comments
 (0)