Skip to content

Commit cbc556a

Browse files
committed
🍄 Review and fixes
1 parent 9f7bfc5 commit cbc556a

File tree

2 files changed

+15
-11
lines changed

2 files changed

+15
-11
lines changed

package.json

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,19 @@
2020
"main": "dist/index.js",
2121
"types": "dist/index.d.ts",
2222
"devDependencies": {
23-
"@tsconfig/node16": "^1.0.2",
24-
"@types/node": "^17.0.23",
23+
"@tsconfig/node16": "^16.1.1",
24+
"@types/node": "^20.10.4",
2525
"@types/node-fetch": "^2",
26-
"jest": "^27.5.1"
26+
"jest": "^29.7.0"
2727
},
2828
"dependencies": {
29-
"dotenv": "^16.0.0",
30-
"fs": "^0.0.1-security",
31-
"json-to-graphql-query": "^2.2.4",
29+
"dotenv": "^16.3.1",
30+
"json-to-graphql-query": "^2.2.5",
3231
"mime-lite": "^1.0.3",
3332
"node-fetch": "^2",
34-
"tiny-invariant": "^1.2.0",
35-
"typescript": "^4.6.3",
36-
"zod": "^3.14.3"
33+
"tiny-invariant": "^1.3.1",
34+
"typescript": "^5.3.3",
35+
"zod": "^3.22.4"
3736
},
3837
"browser": {
3938
"fs": false

src/core/uploadImage.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export async function uploadImageToTenant({
6565
export async function handleImageUpload(
6666
imagePath: string,
6767
apiClient: ClientInterface,
68-
tenantId: string,
68+
tenantId?: string,
6969
): Promise<string | boolean> {
7070
if (!imagePath) {
7171
return 'No image path provided';
@@ -94,8 +94,13 @@ export async function handleImageUpload(
9494
apiClient,
9595
};
9696

97+
const tId = apiClient.config.tenantId ?? tenantId;
98+
if (!tId) {
99+
return 'No tenant id provided';
100+
}
101+
97102
const imageKey = await uploadImageToTenant({
98-
id: tenantId,
103+
id: tId,
99104
...data,
100105
});
101106

0 commit comments

Comments
 (0)