Added requestThumbnailUrls to imaging repository
To move the `imagingModel` configuration into the repository.
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
import type { UmbImagingModel } from './types.js';
|
||||
import { UmbImagingServerDataSource } from './imaging.server.data.js';
|
||||
import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api';
|
||||
import { UmbControllerBase } from '@umbraco-cms/backoffice/class-api';
|
||||
import { ImageCropModeModel } from '@umbraco-cms/backoffice/external/backend-api';
|
||||
import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api';
|
||||
import type { UmbApi } from '@umbraco-cms/backoffice/extension-api';
|
||||
|
||||
export class UmbImagingRepository extends UmbControllerBase implements UmbApi {
|
||||
@@ -25,4 +26,17 @@ export class UmbImagingRepository extends UmbControllerBase implements UmbApi {
|
||||
const error: any = _error;
|
||||
return { data, error };
|
||||
}
|
||||
|
||||
/**
|
||||
* Requests the thumbnail URLs for the given uniques
|
||||
* @param {Array<string>} uniques
|
||||
* @param {number} height
|
||||
* @param {number} width
|
||||
* @returns {*}
|
||||
* @memberof UmbImagingRepository
|
||||
*/
|
||||
async requestThumbnailUrls(uniques: Array<string>, height: number, width: number) {
|
||||
const imagingModel = { height: height, width: width, mode: ImageCropModeModel.MIN };
|
||||
return await this.requestResizedItems(uniques, imagingModel);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user