update: change modal title on modal aspect when create aspect
This commit is contained in:
parent
f097609889
commit
d87b98d828
|
|
@ -29,7 +29,7 @@ export default function AspectFormModal() {
|
|||
const searchParams = routeApi.useSearch();
|
||||
const dataId = searchParams.detail || searchParams.edit;
|
||||
const isDialogOpen = Boolean(dataId || searchParams.create);
|
||||
const formType = searchParams.detail ? "detail" : searchParams.edit ? "edit" : "create";
|
||||
const formType = searchParams.detail ? "detail" : searchParams.edit ? "edit" : "tambah";
|
||||
|
||||
// Fetch aspect data if editing or viewing details
|
||||
const aspectQuery = useQuery(getAspectByIdQueryOptions(dataId));
|
||||
|
|
@ -122,7 +122,7 @@ export default function AspectFormModal() {
|
|||
|
||||
let payload: CreateAspectPayload | EditAspectPayload;
|
||||
|
||||
if (formType === "create") {
|
||||
if (formType === "tambah") {
|
||||
payload = {
|
||||
name: values.name,
|
||||
subAspects: values.subAspects.length > 0
|
||||
|
|
@ -156,7 +156,7 @@ export default function AspectFormModal() {
|
|||
queryClient.invalidateQueries({ queryKey: ["management-aspect"] });
|
||||
|
||||
notifications.show({
|
||||
message: `Aspek ${formType === "create" ? "berhasil dibuat" : "berhasil diedit"}`,
|
||||
message: `Aspek ${formType === "tambah" ? "berhasil dibuat" : "berhasil diedit"}`,
|
||||
});
|
||||
|
||||
navigate({ search: {} });
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user