Skip to content

Commit

Permalink
🍄 Review and fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Plopix committed Dec 14, 2023
1 parent 54c4d17 commit 87e6bd8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
17 changes: 8 additions & 9 deletions components/js-api-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,19 @@
"main": "dist/index.js",
"types": "dist/index.d.ts",
"devDependencies": {
"@tsconfig/node16": "^1.0.2",
"@types/node": "^17.0.23",
"@tsconfig/node16": "^16.1.1",
"@types/node": "^20.10.4",
"@types/node-fetch": "^2",
"jest": "^27.5.1"
"jest": "^29.7.0"
},
"dependencies": {
"dotenv": "^16.0.0",
"fs": "^0.0.1-security",
"json-to-graphql-query": "^2.2.4",
"dotenv": "^16.3.1",
"json-to-graphql-query": "^2.2.5",
"mime-lite": "^1.0.3",
"node-fetch": "^2",
"tiny-invariant": "^1.2.0",
"typescript": "^4.6.3",
"zod": "^3.14.3"
"tiny-invariant": "^1.3.1",
"typescript": "^5.3.3",
"zod": "^3.22.4"
},
"browser": {
"fs": false
Expand Down
9 changes: 7 additions & 2 deletions components/js-api-client/src/core/uploadImage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export async function uploadImageToTenant({
export async function handleImageUpload(
imagePath: string,
apiClient: ClientInterface,
tenantId: string,
tenantId?: string,
): Promise<string | boolean> {
if (!imagePath) {
return 'No image path provided';
Expand Down Expand Up @@ -94,8 +94,13 @@ export async function handleImageUpload(
apiClient,
};

const tId = apiClient.config.tenantId ?? tenantId;
if (!tId) {
return 'No tenant id provided';
}

const imageKey = await uploadImageToTenant({
id: tenantId,
id: tId,
...data,
});

Expand Down

0 comments on commit 87e6bd8

Please sign in to comment.