Skip to content

Commit

Permalink
assign uuid
Browse files Browse the repository at this point in the history
  • Loading branch information
davidsingal committed Jan 3, 2024
1 parent b49469d commit e040a49
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 30 deletions.
3 changes: 2 additions & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"next": "13.5.5",
"next-auth": "4.19.2",
"pino": "8.1.0",
"postcss": "8.3.6",
"postcss": "8.4.31",
"query-string": "8.1.0",
"rc-tree": "5.7.0",
"react": "18.2.0",
Expand All @@ -82,6 +82,7 @@
"@types/node": "16.11.6",
"@types/react": "18.2.28",
"@types/react-dom": "18.2.13",
"@types/uuid": "^9.0.5",
"@typescript-eslint/eslint-plugin": "6.8.0",
"@typescript-eslint/parser": "6.8.0",
"cypress": "13.2.0",
Expand Down
3 changes: 2 additions & 1 deletion client/src/hooks/sourcing-locations/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { useMemo } from 'react';
import { useQuery } from '@tanstack/react-query';
import { merge } from 'lodash-es';
import { v4 as uuidv4 } from 'uuid';

import apiService from 'services/api';

Expand Down Expand Up @@ -91,7 +92,7 @@ export function useSourcingLocationsMaterials(
// duplicate rows when updating the table data. A workaround is to generate uuids.
// We won't be loading many rows at once so it shouldn't be a huge performance hit.
((response as SourcingLocationsMaterialsAPIResponse).data || []).map((data) => ({
// id: uuidv4(),
id: uuidv4(),
...data,
})) || [],
meta: (response as SourcingLocationsMaterialsAPIResponse).meta || {},
Expand Down
37 changes: 9 additions & 28 deletions client/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2020,6 +2020,13 @@ __metadata:
languageName: node
linkType: hard

"@types/uuid@npm:^9.0.5":
version: 9.0.5
resolution: "@types/uuid@npm:9.0.5"
checksum: 7577940949619768303c0bf0a7cc235fac3cfae1c0bb4a2e85bfb87b2eb1024955ab446f775394d259442cd769b663b6ce43c39bdfc955d946bf833804ddb421
languageName: node
linkType: hard

"@types/yauzl@npm:^2.9.1":
version: 2.10.0
resolution: "@types/yauzl@npm:2.10.0"
Expand Down Expand Up @@ -6474,6 +6481,7 @@ __metadata:
"@types/node": 16.11.6
"@types/react": 18.2.28
"@types/react-dom": 18.2.13
"@types/uuid": ^9.0.5
"@typescript-eslint/eslint-plugin": 6.8.0
"@typescript-eslint/parser": 6.8.0
autoprefixer: 10.2.5
Expand Down Expand Up @@ -6502,7 +6510,7 @@ __metadata:
nyc: 15.1.0
nyc-report-lcov-absolute: 1.0.0
pino: 8.1.0
postcss: 8.3.6
postcss: 8.4.31
prettier: 2.8.3
query-string: 8.1.0
rc-tree: 5.7.0
Expand Down Expand Up @@ -7079,15 +7087,6 @@ __metadata:
languageName: node
linkType: hard

"nanoid@npm:^3.1.23":
version: 3.3.4
resolution: "nanoid@npm:3.3.4"
bin:
nanoid: bin/nanoid.cjs
checksum: 2fddd6dee994b7676f008d3ffa4ab16035a754f4bb586c61df5a22cf8c8c94017aadd360368f47d653829e0569a92b129979152ff97af23a558331e47e37cd9c
languageName: node
linkType: hard

"nanoid@npm:^3.3.6":
version: 3.3.6
resolution: "nanoid@npm:3.3.6"
Expand Down Expand Up @@ -7868,17 +7867,6 @@ __metadata:
languageName: node
linkType: hard

"postcss@npm:8.3.6":
version: 8.3.6
resolution: "postcss@npm:8.3.6"
dependencies:
colorette: ^1.2.2
nanoid: ^3.1.23
source-map-js: ^0.6.2
checksum: ff55b91bea21f42c2a94d77fd05c3f66dd15889c68506cf1dbb9cdee8c3b9e9d0e219bcbc6e61a107bd63e3cac0670176486e2a5794c106a4e1b9babceb79317
languageName: node
linkType: hard

"postcss@npm:8.4.31":
version: 8.4.31
resolution: "postcss@npm:8.4.31"
Expand Down Expand Up @@ -9180,13 +9168,6 @@ __metadata:
languageName: node
linkType: hard

"source-map-js@npm:^0.6.2":
version: 0.6.2
resolution: "source-map-js@npm:0.6.2"
checksum: 9c8151a29e00fd8d3ba87709fdf9a9ce48313d653f4a29a39b4ae53d346ac79e005de624796ff42eff55cbaf26d2e87f4466001ca87831d400d818c5cf146a0e
languageName: node
linkType: hard

"source-map-js@npm:^1.0.2":
version: 1.0.2
resolution: "source-map-js@npm:1.0.2"
Expand Down

0 comments on commit e040a49

Please sign in to comment.