Skip to content

Commit 89d22c8

Browse files
authored
Merge pull request #120 from BinaryStudioAcademy/fix/thjs-65-fixed-file-upload-content-type
thjs-65: * Fixed file upload
2 parents 3b42d2f + d721e7d commit 89d22c8

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

client/src/packages/http/http-api.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ContentType, StorageKey } from '~/libs/enums/enums.js';
1+
import { StorageKey } from '~/libs/enums/enums.js';
22
import { getStringifiedQuery } from '~/libs/helpers/helpers.js';
33
import { type ValueOf } from '~/libs/types/types.js';
44

@@ -27,7 +27,7 @@ class Http implements HttpApi {
2727
method = HttpMethod.GET,
2828
payload = null,
2929
hasAuth = true,
30-
contentType = ContentType.JSON,
30+
contentType,
3131
query
3232
} = options;
3333
const headers = this.#getHeaders({
@@ -48,7 +48,7 @@ class Http implements HttpApi {
4848
#getHeaders({
4949
hasAuth,
5050
contentType
51-
}: Pick<HttpOptions, 'hasAuth' | 'contentType'>): Headers {
51+
}: Partial<Pick<HttpOptions, 'hasAuth' | 'contentType'>>): Headers {
5252
const headers = new Headers();
5353

5454
if (contentType) {

client/src/packages/http/libs/types/http-options.type.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ type HttpOptions = {
99
headers: Headers;
1010
hasAuth: boolean;
1111
query: Record<string, unknown>;
12-
contentType: ValueOf<typeof ContentType>;
12+
contentType?: ValueOf<typeof ContentType> | undefined;
1313
};
1414

1515
export { type HttpOptions };

0 commit comments

Comments
 (0)