@mtgame/core 0.0.73 → 0.0.74
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api/file-api.d.ts +1 -1
- package/bundles/mtgame-core.umd.js +7 -3
- package/bundles/mtgame-core.umd.js.map +1 -1
- package/bundles/mtgame-core.umd.min.js +1 -1
- package/bundles/mtgame-core.umd.min.js.map +1 -1
- package/esm2015/api/file-api.js +8 -4
- package/esm5/api/file-api.js +9 -5
- package/fesm2015/mtgame-core.js +6 -2
- package/fesm2015/mtgame-core.js.map +1 -1
- package/fesm5/mtgame-core.js +7 -3
- package/fesm5/mtgame-core.js.map +1 -1
- package/package.json +1 -1
package/fesm5/mtgame-core.js
CHANGED
|
@@ -2590,14 +2590,18 @@ var FileApi = /** @class */ (function () {
|
|
|
2590
2590
|
this.httpClient = httpClient;
|
|
2591
2591
|
this.configService = configService;
|
|
2592
2592
|
}
|
|
2593
|
-
FileApi.prototype.upload = function (fileData, filename) {
|
|
2593
|
+
FileApi.prototype.upload = function (fileData, filename, width, height) {
|
|
2594
2594
|
return __awaiter(this, void 0, void 0, function () {
|
|
2595
|
-
var formData;
|
|
2595
|
+
var params, formData;
|
|
2596
2596
|
return __generator(this, function (_a) {
|
|
2597
|
+
params = new HttpParams();
|
|
2598
|
+
if (width && height) {
|
|
2599
|
+
params.set('width', width.toString()).set('height', height.toString());
|
|
2600
|
+
}
|
|
2597
2601
|
formData = new FormData();
|
|
2598
2602
|
formData.append('file', fileData, filename);
|
|
2599
2603
|
return [2 /*return*/, this.httpClient
|
|
2600
|
-
.post(this.configService.get('apiUrl') + "/api/v1/file/", formData)
|
|
2604
|
+
.post(this.configService.get('apiUrl') + "/api/v1/file/", formData, { params: params })
|
|
2601
2605
|
.pipe(map(function (data) { return File.toFront(data); }))
|
|
2602
2606
|
.toPromise()];
|
|
2603
2607
|
});
|