Skip to content

Commit 1e8a7ff

Browse files
committed
accept variant ids
1 parent 26bf377 commit 1e8a7ff

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/packages/documents/documents/repository/validation/document-validation.repository.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import type { UmbDocumentDetailModel } from '../../types.js';
22
import { UmbDocumentValidationServerDataSource } from './document-validation.server.data-source.js';
3+
import type { UmbVariantId } from '@umbraco-cms/backoffice/variant';
34
import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api';
45
import { UmbRepositoryBase } from '@umbraco-cms/backoffice/repository';
56

@@ -18,26 +19,28 @@ export class UmbDocumentValidationRepository extends UmbRepositoryBase {
1819
* Returns a promise with an observable of the detail for the given unique
1920
* @param {DetailModelType} model
2021
* @param {string | null} [parentUnique]
22+
* @param variantIds
2123
* @returns {*}
2224
* @memberof UmbDetailRepositoryBase
2325
*/
24-
async validateCreate(model: DetailModelType, parentUnique: string | null) {
26+
async validateCreate(model: DetailModelType, parentUnique: string | null, variantIds: Array<UmbVariantId>) {
2527
if (!model) throw new Error('Data is missing');
2628

27-
return this.#validationDataSource.validateCreate(model, parentUnique);
29+
return this.#validationDataSource.validateCreate(model, parentUnique, variantIds);
2830
}
2931

3032
/**
3133
* Saves the given data
3234
* @param {DetailModelType} model
35+
* @param variantIds
3336
* @returns {*}
3437
* @memberof UmbDetailRepositoryBase
3538
*/
36-
async validateSave(model: DetailModelType) {
39+
async validateSave(model: DetailModelType, variantIds: Array<UmbVariantId>) {
3740
if (!model) throw new Error('Data is missing');
3841
if (!model.unique) throw new Error('Unique is missing');
3942

40-
return this.#validationDataSource.validateUpdate(model);
43+
return this.#validationDataSource.validateUpdate(model, variantIds);
4144
}
4245
}
4346

0 commit comments

Comments
 (0)