1
1
import type { UmbDocumentDetailModel } from '../../types.js' ;
2
2
import { UmbDocumentValidationServerDataSource } from './document-validation.server.data-source.js' ;
3
+ import type { UmbVariantId } from '@umbraco-cms/backoffice/variant' ;
3
4
import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api' ;
4
5
import { UmbRepositoryBase } from '@umbraco-cms/backoffice/repository' ;
5
6
@@ -18,26 +19,28 @@ export class UmbDocumentValidationRepository extends UmbRepositoryBase {
18
19
* Returns a promise with an observable of the detail for the given unique
19
20
* @param {DetailModelType } model
20
21
* @param {string | null } [parentUnique]
22
+ * @param variantIds
21
23
* @returns {* }
22
24
* @memberof UmbDetailRepositoryBase
23
25
*/
24
- async validateCreate ( model : DetailModelType , parentUnique : string | null ) {
26
+ async validateCreate ( model : DetailModelType , parentUnique : string | null , variantIds : Array < UmbVariantId > ) {
25
27
if ( ! model ) throw new Error ( 'Data is missing' ) ;
26
28
27
- return this . #validationDataSource. validateCreate ( model , parentUnique ) ;
29
+ return this . #validationDataSource. validateCreate ( model , parentUnique , variantIds ) ;
28
30
}
29
31
30
32
/**
31
33
* Saves the given data
32
34
* @param {DetailModelType } model
35
+ * @param variantIds
33
36
* @returns {* }
34
37
* @memberof UmbDetailRepositoryBase
35
38
*/
36
- async validateSave ( model : DetailModelType ) {
39
+ async validateSave ( model : DetailModelType , variantIds : Array < UmbVariantId > ) {
37
40
if ( ! model ) throw new Error ( 'Data is missing' ) ;
38
41
if ( ! model . unique ) throw new Error ( 'Unique is missing' ) ;
39
42
40
- return this . #validationDataSource. validateUpdate ( model ) ;
43
+ return this . #validationDataSource. validateUpdate ( model , variantIds ) ;
41
44
}
42
45
}
43
46
0 commit comments