-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(variable-input): add create and update
- Loading branch information
Showing
9 changed files
with
206 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { Row, Space } from "antd"; | ||
import React from "react"; | ||
|
||
interface IProps { | ||
actions: React.ReactNode[]; | ||
} | ||
|
||
const ButtonAction: React.FC<IProps> = ({ actions }) => { | ||
return ( | ||
<Row justify="end"> | ||
<Space>{actions.map((action) => action)}</Space> | ||
</Row> | ||
); | ||
}; | ||
|
||
export default ButtonAction; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export interface IVariableInputStoreUpdateRequest { | ||
name: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { IVariableInputStoreUpdateRequest } from "@/interfaces/requests/VariableInput"; | ||
import { IBaseResponse } from "@/interfaces/responses/base"; | ||
import { | ||
variableInputStore, | ||
variableInputUpdate, | ||
} from "@/services/apis/VariableInput"; | ||
import { UseMutationOptions, useMutation } from "@tanstack/react-query"; | ||
|
||
export const useVariableInputMutationStore = ( | ||
options?: UseMutationOptions< | ||
IBaseResponse<unknown>, | ||
IBaseResponse<unknown>, | ||
IVariableInputStoreUpdateRequest | ||
> | ||
) => { | ||
return useMutation({ | ||
mutationKey: ["store-variable-input"], | ||
mutationFn: (payload) => variableInputStore(payload), | ||
...options, | ||
}); | ||
}; | ||
|
||
export const useVariableInputMutationUpdate = ( | ||
id, | ||
options?: UseMutationOptions< | ||
IBaseResponse<unknown>, | ||
IBaseResponse<unknown>, | ||
IVariableInputStoreUpdateRequest | ||
> | ||
) => { | ||
return useMutation({ | ||
mutationKey: ["update-variable-input", id], | ||
mutationFn: (payload) => variableInputUpdate(id, payload), | ||
...options, | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters