mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-08 06:25:45 +01:00
Improve diverse form features
- General responsiveness - Resize select component - Fix datepicker for dark themes - Make success notification configurable Committed-by: Eduard Heimbuch <eduard.heimbuch@cloudogu.com> Co-authored-by: René Pfeuffer <rene.pfeuffer@cloudogu.com> Reviewed-by: Rene Pfeuffer <rene.pfeuffer@cloudogu.com>
This commit is contained in:
committed by
SCM-Manager
parent
026ffa18fd
commit
b53f8bcf12
@@ -32,7 +32,7 @@ type Result<C extends HalRepresentation> = {
|
||||
configuration: C;
|
||||
};
|
||||
|
||||
type MutationVariables<C extends HalRepresentation> = {
|
||||
type MutationVariables<C> = {
|
||||
configuration: C;
|
||||
contentType: string;
|
||||
link: string;
|
||||
@@ -53,8 +53,8 @@ export const useConfigLink = <C extends HalRepresentation>(link: string) => {
|
||||
error: mutationError,
|
||||
mutateAsync,
|
||||
data: updateResponse,
|
||||
} = useMutation<Response, Error, MutationVariables<C>>(
|
||||
(vars: MutationVariables<C>) => apiClient.put(vars.link, vars.configuration, vars.contentType),
|
||||
} = useMutation<Response, Error, MutationVariables<Omit<C, keyof HalRepresentation>>>(
|
||||
(vars) => apiClient.put(vars.link, vars.configuration, vars.contentType),
|
||||
{
|
||||
onSuccess: async () => {
|
||||
await queryClient.invalidateQueries(queryKey);
|
||||
@@ -65,7 +65,7 @@ export const useConfigLink = <C extends HalRepresentation>(link: string) => {
|
||||
const isReadOnly = !data?.configuration._links.update;
|
||||
|
||||
const update = useCallback(
|
||||
(configuration: C) => {
|
||||
(configuration: Omit<C, keyof HalRepresentation>) => {
|
||||
if (data && !isReadOnly) {
|
||||
return mutateAsync({
|
||||
configuration,
|
||||
|
||||
Reference in New Issue
Block a user