Bug 38201: Move 'created' call into base-resource

Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Matt Blenkinsop 2025-06-23 15:34:18 +01:00 committed by Lucas Gass
parent c954d0b590
commit 07c9d989e2
No known key found for this signature in database
GPG Key ID: 60B447398B0D36CA
9 changed files with 16 additions and 28 deletions

View File

@ -116,7 +116,6 @@ export default {
);
}
};
baseResource.created();
return {
...baseResource,

View File

@ -853,8 +853,6 @@ export default {
table.redraw(tableUrl(filters));
};
baseResource.created();
return {
...baseResource,
tableOptions,

View File

@ -360,7 +360,6 @@ export default {
},
];
};
baseResource.created();
return {
...baseResource,

View File

@ -516,8 +516,6 @@ export default {
}
};
baseResource.created();
return {
...baseResource,
tableOptions,

View File

@ -382,8 +382,6 @@ export default {
}
};
baseResource.created();
return {
...baseResource,
tableOptions,

View File

@ -431,8 +431,6 @@ export default {
];
};
baseResource.created();
return {
...baseResource,
tableOptions,

View File

@ -276,8 +276,6 @@ export default {
},
};
baseResource.created();
return {
...baseResource,
tableOptions,

View File

@ -857,8 +857,6 @@ export default {
];
};
baseResource.created();
return {
...baseResource,
tableOptions,

View File

@ -347,20 +347,6 @@ export function useBaseResource(instancedResource) {
});
};
/**
* Initializes the component by populating resource attributes
* with their respective authorised values. This ensures that
* any select or relationship attributes have the correct options
* or authorised values assigned before the component is used.
*/
const created = () => {
if (instancedResource.resourceAttrs) {
populateAttributesWithAuthorisedValues(
instancedResource.resourceAttrs
);
}
};
/**
* Retrieves a resource by id and assigns it to the component data.
* If the resource component has an 'afterResourceFetch' method, it is called
@ -620,6 +606,22 @@ export function useBaseResource(instancedResource) {
refreshTemplate.value++;
};
/**
* Initializes the component by populating resource attributes
* with their respective authorised values. This ensures that
* any select or relationship attributes have the correct options
* or authorised values assigned before the component is used.
*/
const created = () => {
if (instancedResource.resourceAttrs) {
populateAttributesWithAuthorisedValues(
instancedResource.resourceAttrs
);
}
};
created();
return {
...instancedResource,
...moduleStoreUtils,