Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"prettier:write": "prettier --write ."
},
"dependencies": {
"@acm-uiuc/core-client": "^4.1.9",
"@acm-uiuc/core-client": "^4.1.10",
"@acm-uiuc/js-shared": "^3.2.0",
"@azure/msal-browser": "^4.15.0",
"@azure/msal-react": "^3.0.15",
Expand Down
13 changes: 2 additions & 11 deletions src/app/(membership)/store/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { transformApiResponse } from './transform';
import { storeApiClient } from '@/utils/api';
import { ApiV1StoreProductsGet200Response } from '@acm-uiuc/core-client';

type Product = ApiV1StoreProductsGet200Response['products'][number];
const MerchStore = () => {
const [itemsList, setItemsList] = useState<Array<Record<string, any>>>([]);
const baseUrl = process.env.NEXT_PUBLIC_CORE_API_BASE_URL;
Expand All @@ -21,15 +20,7 @@ const MerchStore = () => {
const metaLoader = async () => {
try {
const data = await storeApiClient.apiV1StoreProductsGet();
const filteredData = {
products: data.products.filter(
(
x,
): x is Product & { productId: NonNullable<Product['productId']> } =>
x.productId !== null,
),
};
setItemsList(transformApiResponse(filteredData));
setItemsList(transformApiResponse(data));
} catch (e) {
console.error('failed to get products', e);
setItemsList([
Expand Down Expand Up @@ -84,7 +75,7 @@ const MerchStore = () => {
<p>
<b>Cost:</b> ${decimalHelper(val['item_price']['paid'])} for{' '}
{val['valid_member_lists'] &&
val['valid_member_lists'].length > 0
val['valid_member_lists'].length > 0
? 'paid ACM@UIUC and eligible partner organization'
: 'paid ACM@UIUC'}{' '}
members, ${decimalHelper(val['item_price']['others'])} for
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
# yarn lockfile v1


"@acm-uiuc/core-client@^4.1.9":
version "4.1.9"
resolved "https://registry.yarnpkg.com/@acm-uiuc/core-client/-/core-client-4.1.9.tgz#16858703ca1f35e550ddae7df616ef573829f8ed"
integrity sha512-Zc1WU0d5skEiomSWb+j1QtiIKhpYVBSEVHTURUY/QCUD9Mg01muJPYrnfkB1r0OlszTF2OqXH838mlia+Hh8Lg==
"@acm-uiuc/core-client@^4.1.10":
version "4.1.10"
resolved "https://registry.yarnpkg.com/@acm-uiuc/core-client/-/core-client-4.1.10.tgz#7c4c035c6fd9fced63690f2001b1cf109a307669"
integrity sha512-pSAhfS9C7cuy12Q67D4I+ADv3cy2kq9czE2oe5vEZW//TYB6zwFQU+toZqrbScniG38NLeq/4Z1CLcDovGXNyw==

"@acm-uiuc/js-shared@^3.2.0":
version "3.2.0"
Expand Down
Loading