diff options
Diffstat (limited to 'shared/extra-utils/requests/requests.ts')
-rw-r--r-- | shared/extra-utils/requests/requests.ts | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/shared/extra-utils/requests/requests.ts b/shared/extra-utils/requests/requests.ts index 3e773ee03..8b5cddf4a 100644 --- a/shared/extra-utils/requests/requests.ts +++ b/shared/extra-utils/requests/requests.ts | |||
@@ -152,11 +152,12 @@ function makeHTMLRequest (url: string, path: string) { | |||
152 | .expect(HttpStatusCode.OK_200) | 152 | .expect(HttpStatusCode.OK_200) |
153 | } | 153 | } |
154 | 154 | ||
155 | function updateAvatarRequest (options: { | 155 | function updateImageRequest (options: { |
156 | url: string | 156 | url: string |
157 | path: string | 157 | path: string |
158 | accessToken: string | 158 | accessToken: string |
159 | fixture: string | 159 | fixture: string |
160 | fieldname: string | ||
160 | }) { | 161 | }) { |
161 | let filePath = '' | 162 | let filePath = '' |
162 | if (isAbsolute(options.fixture)) { | 163 | if (isAbsolute(options.fixture)) { |
@@ -170,7 +171,7 @@ function updateAvatarRequest (options: { | |||
170 | path: options.path, | 171 | path: options.path, |
171 | token: options.accessToken, | 172 | token: options.accessToken, |
172 | fields: {}, | 173 | fields: {}, |
173 | attaches: { avatarfile: filePath }, | 174 | attaches: { [options.fieldname]: filePath }, |
174 | statusCodeExpected: HttpStatusCode.OK_200 | 175 | statusCodeExpected: HttpStatusCode.OK_200 |
175 | }) | 176 | }) |
176 | } | 177 | } |
@@ -191,5 +192,5 @@ export { | |||
191 | makePutBodyRequest, | 192 | makePutBodyRequest, |
192 | makeDeleteRequest, | 193 | makeDeleteRequest, |
193 | makeRawRequest, | 194 | makeRawRequest, |
194 | updateAvatarRequest | 195 | updateImageRequest |
195 | } | 196 | } |