Skip to content

Commit

Permalink
Merge pull request #328 from scientist-softserv/327-browse-all-wares
Browse files Browse the repository at this point in the history
327 browse all wares
  • Loading branch information
alishaevn authored Nov 30, 2023
2 parents d55f360 + a047ff4 commit ebd1801
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 3 additions & 2 deletions utils/api/services.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import useSWR from 'swr'
import { API_PER_PAGE } from '../constants'

/** GET METHODS */
export const useAllWares = (accessToken) => {
const { data, error } = useSWR([`/wares.json`, accessToken])
const { data, error } = useSWR([`/wares.json?per_page=${API_PER_PAGE}`, accessToken])

return {
wares: data?.ware_refs,
Expand All @@ -12,7 +13,7 @@ export const useAllWares = (accessToken) => {
}

export const useFilteredWares = (query, accessToken) => {
const { data, error } = useSWR([`/wares.json?q=${query}`, accessToken])
const { data, error } = useSWR([`/wares.json?per_page=${API_PER_PAGE}&q=${query}`, accessToken])

return {
wares: data?.ware_refs.filter(item => item.slug !== 'make-a-request'),
Expand Down
2 changes: 2 additions & 0 deletions utils/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ export const FEATURED_SERVICE_PATH = '/requests/new'
// the default is 1 week
export const EXPIRATION_DURATION = 604800000

export const API_PER_PAGE = 2000

export const WEBHOOK_EVENTS = {
'signer': {
'signature_voided': false,
Expand Down

1 comment on commit ebd1801

@vercel
Copy link

@vercel vercel bot commented on ebd1801 Nov 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.