mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-08 06:25:45 +01:00
Add ConfigurationAdapterBase and extension points for trash bin
Adds the new abstract class ConfigurationAdapterBase to simplify the creation of global configuration views. In addition there is some cleanup, interfaces and extension points for the repository trash bin plugin. Committed-by: Eduard Heimbuch <eduard.heimbuch@cloudogu.com> Co-authored-by: Eduard Heimbuch <eduard.heimbuch@cloudogu.com> Co-authored-by: René Pfeuffer <rene.pfeuffer@cloudogu.com> Co-authored-by: Konstantin Schaper <konstantin.schaper@cloudogu.com>
This commit is contained in:
@@ -51,7 +51,7 @@ export const useConfigLink = <C extends HalRepresentation>(link: string) => {
|
||||
const {
|
||||
isLoading: isUpdating,
|
||||
error: mutationError,
|
||||
mutate,
|
||||
mutateAsync,
|
||||
data: updateResponse,
|
||||
} = useMutation<Response, Error, MutationVariables<C>>(
|
||||
(vars: MutationVariables<C>) => apiClient.put(vars.link, vars.configuration, vars.contentType),
|
||||
@@ -67,7 +67,7 @@ export const useConfigLink = <C extends HalRepresentation>(link: string) => {
|
||||
const update = useCallback(
|
||||
(configuration: C) => {
|
||||
if (data && !isReadOnly) {
|
||||
mutate({
|
||||
return mutateAsync({
|
||||
configuration,
|
||||
contentType: data.contentType,
|
||||
link: (data.configuration._links.update as Link).href,
|
||||
@@ -76,7 +76,7 @@ export const useConfigLink = <C extends HalRepresentation>(link: string) => {
|
||||
},
|
||||
// eslint means we should add C to the dependency array, but C is only a type
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
[mutate, data, isReadOnly]
|
||||
[mutateAsync, data, isReadOnly]
|
||||
);
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user