Skip to content

Commit b8e89c8

Browse files
authored
Merge pull request #270 from scientist-softserv/add-no-results-message
No results message
2 parents 75b2dc8 + bbb3395 commit b8e89c8

File tree

3 files changed

+26
-14
lines changed

3 files changed

+26
-14
lines changed

pages/browse/index.js

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -58,19 +58,29 @@ const Browse = () => {
5858
<ItemLoading orientation='horizontal' withButtonLink={true} />
5959
</>
6060
) : (
61-
services.map(service => (
62-
<Item
63-
key={service.id}
64-
item={service}
65-
withButtonLink={true}
66-
buttonLink={service.href}
67-
orientation='horizontal'
68-
buttonProps={{
69-
backgroundColor: buttonBg,
70-
label: 'Request this item',
71-
}}
72-
/>
73-
))
61+
<>
62+
{(services.length > 0) ? (
63+
<>
64+
{services.map(service => (
65+
<Item
66+
key={service.id}
67+
item={service}
68+
withButtonLink={true}
69+
buttonLink={service.href}
70+
orientation='horizontal'
71+
buttonProps={{
72+
backgroundColor: buttonBg,
73+
label: 'Request this item',
74+
}}
75+
/>
76+
))}
77+
</>
78+
) : (
79+
<p>
80+
Your search for <b>{query}</b> returned no results. Please try another search term.
81+
</p>
82+
)}
83+
</>
7484
)
7585
}
7686
</div>

pages/requests/[uuid].js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ const Request = () => {
5555
setIsPOError(isPOError)
5656
})()
5757
}
58-
}, [allPOs, isPOError, request, uuid, session])
58+
}, [allPOs, isPOError, request, uuid, session, accessToken])
5959

6060
const isLoading = isLoadingRequest || isLoadingSOWs || isLoadingFiles || isLoadingMessages || isLoadingPOs
6161
const isError = isRequestError || isSOWError || isFilesError|| isMessagesError || isPOError

utils/api/requests.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,13 +275,15 @@ export const acceptSOW = (request, sowID, accessToken) => {
275275
...sharedRequestData,
276276
name: request.title,
277277
description: request.description,
278+
/* eslint-disable camelcase */
278279
provider_names: [process.env.NEXT_PUBLIC_PROVIDER_NAME],
279280
winning_proposal_id: sowID,
280281
purchase_justifications: [''],
281282
purchase_justification_comment: '',
282283
}
283284

284285
return posting(`/quote_groups/${request.id}/accept_sow.json`, { pg_quote_group: sow }, accessToken)
286+
/* eslint-enable camelcase */
285287
}
286288

287289
/** PUT METHODS */

0 commit comments

Comments
 (0)