update: question form modal title
This commit is contained in:
parent
9a1e98325e
commit
4aa10b3125
|
|
@ -57,7 +57,7 @@ export default function QuestionFormModal() {
|
|||
const isModalOpen = Boolean(dataId || searchParams.create);
|
||||
const detailId = searchParams.detail;
|
||||
const editId = searchParams.edit;
|
||||
const formType = detailId ? "detail" : editId ? "edit" : "create";
|
||||
const formType = detailId ? "detail" : editId ? "edit" : "tambah";
|
||||
|
||||
const form = useForm({
|
||||
initialValues: {
|
||||
|
|
@ -126,7 +126,7 @@ export default function QuestionFormModal() {
|
|||
|
||||
// Define possible actions, depending on the action, it can be one or the other
|
||||
interface MutationOptions {
|
||||
action: "edit" | "create";
|
||||
action: "edit" | "tambah";
|
||||
data: CreateQuestionPayload | UpdateQuestionPayload;
|
||||
}
|
||||
|
||||
|
|
@ -161,8 +161,8 @@ export default function QuestionFormModal() {
|
|||
};
|
||||
|
||||
try {
|
||||
if (formType === "create") {
|
||||
await mutation.mutateAsync({ action: "create", data: payload });
|
||||
if (formType === "tambah") {
|
||||
await mutation.mutateAsync({ action: "tambah", data: payload });
|
||||
notifications.show({
|
||||
message: "Data pertanyaan berhasil dibuat!",
|
||||
color: "green",
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user