QC User & Admin Responsive : Menu Landing Page - Desa
This commit is contained in:
@@ -26,7 +26,7 @@ export default function DetailResponden() {
|
||||
stateDetail.delete.byId(selectedId)
|
||||
setModalHapus(false)
|
||||
setSelectedId(null)
|
||||
router.push("/admin/ppid/ikm-desa-darmasaba/responden")
|
||||
router.push("/admin/landing-page/indeks-kepuasan-masyarakat/responden")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
'use client'
|
||||
import { usePathname, useRouter } from 'next/navigation';
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { Stack, Tabs, TabsList, TabsPanel, TabsTab, Title, Tooltip } from '@mantine/core';
|
||||
import { ScrollArea, Stack, Tabs, TabsList, TabsPanel, TabsTab, Title, Tooltip } from '@mantine/core';
|
||||
import { IconCategory, IconListDetails } from '@tabler/icons-react';
|
||||
import colors from '@/con/colors';
|
||||
|
||||
@@ -58,6 +58,7 @@ function LayoutTabs({ children }: { children: React.ReactNode }) {
|
||||
radius="lg"
|
||||
keepMounted={false}
|
||||
>
|
||||
<ScrollArea type="auto" offsetScrollbars>
|
||||
<TabsList
|
||||
p="sm"
|
||||
style={{
|
||||
@@ -82,6 +83,7 @@ function LayoutTabs({ children }: { children: React.ReactNode }) {
|
||||
</Tooltip>
|
||||
))}
|
||||
</TabsList>
|
||||
</ScrollArea>
|
||||
|
||||
{tabs.map((tab, i) => (
|
||||
<TabsPanel
|
||||
|
||||
@@ -170,12 +170,11 @@ function CreatePrestasiDesa() {
|
||||
required
|
||||
/>
|
||||
|
||||
<Group justify="flex-end" mt="md">
|
||||
<Group justify="space-between" mt="md">
|
||||
<Button
|
||||
variant="light"
|
||||
color="gray"
|
||||
onClick={() => router.back()}
|
||||
style={{ marginRight: 'auto' }}
|
||||
>
|
||||
Batal
|
||||
</Button>
|
||||
|
||||
@@ -46,12 +46,19 @@ function EditPejabatDesa() {
|
||||
const profileData = await profileLandingPageState.pejabatDesa.findUnique.load(id);
|
||||
|
||||
if (profileData) {
|
||||
// Initialize form data
|
||||
setFormData({
|
||||
name: profileData.name || '',
|
||||
position: profileData.position || '',
|
||||
imageId: profileData.imageId || null,
|
||||
});
|
||||
|
||||
// Initialize edit state with profile data
|
||||
profileLandingPageState.pejabatDesa.edit.initialize({
|
||||
...profileData,
|
||||
imageId: profileData.imageId || ''
|
||||
});
|
||||
|
||||
if (profileData.image?.link) {
|
||||
setPreviewImage(profileData.image.link);
|
||||
}
|
||||
@@ -110,7 +117,14 @@ function EditPejabatDesa() {
|
||||
imageId = uploaded.id;
|
||||
}
|
||||
|
||||
// Update global state only on submit
|
||||
// Ensure we have the ID from the URL
|
||||
const id = params?.id as string;
|
||||
if (!id) {
|
||||
throw new Error("ID tidak ditemukan");
|
||||
}
|
||||
|
||||
// Update global state with the ID and form data
|
||||
profileLandingPageState.pejabatDesa.edit.id = id;
|
||||
profileLandingPageState.pejabatDesa.edit.form = {
|
||||
...formData,
|
||||
imageId: imageId || '', // Ensure imageId is always a string
|
||||
|
||||
Reference in New Issue
Block a user