Fix Compres Gambar && seed gambar profile - landing page
This commit is contained in:
@@ -23,7 +23,12 @@ type ProgramInovasiForm = Prisma.ProgramInovasiGetPayload<{
|
||||
|
||||
const programInovasi = proxy({
|
||||
create: {
|
||||
form: {} as ProgramInovasiForm,
|
||||
form: {
|
||||
name: "",
|
||||
description: "",
|
||||
imageId: "",
|
||||
link: ""
|
||||
} as ProgramInovasiForm,
|
||||
loading: false,
|
||||
async create() {
|
||||
// Ensure all required fields are non-null
|
||||
|
||||
@@ -72,7 +72,7 @@ const sdgsDesa = proxy({
|
||||
].get({
|
||||
query,
|
||||
});
|
||||
|
||||
|
||||
if (res.status === 200 && res.data?.success) {
|
||||
sdgsDesa.findMany.data = res.data.data || [];
|
||||
sdgsDesa.findMany.total = res.data.total || 0;
|
||||
@@ -94,7 +94,7 @@ const sdgsDesa = proxy({
|
||||
},
|
||||
},
|
||||
findUnique: {
|
||||
data: null as Prisma.SDGSDesaGetPayload<{
|
||||
data: null as Prisma.SdgsDesaGetPayload<{
|
||||
include: {
|
||||
image: true;
|
||||
};
|
||||
|
||||
@@ -91,7 +91,7 @@ function EditKolaborasiInovasi() {
|
||||
|
||||
await sdgsState.edit.update();
|
||||
toast.success("sdgs desa berhasil diperbarui!");
|
||||
router.push("/admin/landing-page/sdgs");
|
||||
router.push("/admin/landing-page/sdgs-desa");
|
||||
} catch (error) {
|
||||
console.error("Error updating sdgs desa:", error);
|
||||
toast.error("Terjadi kesalahan saat memperbarui sdgs desa");
|
||||
@@ -107,7 +107,7 @@ function EditKolaborasiInovasi() {
|
||||
</Button>
|
||||
</Tooltip>
|
||||
<Title order={4} ml="sm" c="dark">
|
||||
Edit SDGs Desa
|
||||
Edit Sdgs Desa
|
||||
</Title>
|
||||
</Group>
|
||||
|
||||
@@ -122,7 +122,7 @@ function EditKolaborasiInovasi() {
|
||||
<Stack gap="md">
|
||||
<Box>
|
||||
<Text fw="bold" fz="sm" mb={6}>
|
||||
Gambar SDGs Desa
|
||||
Gambar Sdgs Desa
|
||||
</Text>
|
||||
<Dropzone
|
||||
onDrop={(files) => {
|
||||
@@ -172,8 +172,8 @@ function EditKolaborasiInovasi() {
|
||||
</Box>
|
||||
|
||||
<TextInput
|
||||
label="Nama SDGs Desa"
|
||||
placeholder="Masukkan nama SDGs Desa"
|
||||
label="Nama Sdgs Desa"
|
||||
placeholder="Masukkan nama Sdgs Desa"
|
||||
value={formData.name}
|
||||
onChange={(e) => setFormData({ ...formData, name: e.target.value })}
|
||||
required
|
||||
@@ -27,7 +27,7 @@ function DetailSDGSDesa() {
|
||||
sdgsState.delete.byId(selectedId)
|
||||
setModalHapus(false)
|
||||
setSelectedId(null)
|
||||
router.push("/admin/landing-page/sdgs")
|
||||
router.push("/admin/landing-page/sdgs-desa")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,13 +62,13 @@ function DetailSDGSDesa() {
|
||||
>
|
||||
<Stack gap="md">
|
||||
<Text fz="2xl" fw="bold" c={colors['blue-button']}>
|
||||
Detail SDGs Desa
|
||||
Detail Sdgs Desa
|
||||
</Text>
|
||||
|
||||
<Paper bg="#ECEEF8" p="md" radius="md" shadow="xs">
|
||||
<Stack gap="md">
|
||||
<Box>
|
||||
<Text fz="lg" fw="bold" mb={4}>Nama SDGs Desa</Text>
|
||||
<Text fz="lg" fw="bold" mb={4}>Nama Sdgs Desa</Text>
|
||||
<Text fz="md" c="dimmed">{data.name || '-'}</Text>
|
||||
</Box>
|
||||
|
||||
@@ -82,7 +82,7 @@ function DetailSDGSDesa() {
|
||||
{data.image?.link ? (
|
||||
<Image
|
||||
src={data.image.link}
|
||||
alt={data.name || 'Gambar SDGs Desa'}
|
||||
alt={data.name || 'Gambar Sdgs Desa'}
|
||||
w={200}
|
||||
h={200}
|
||||
radius="md"
|
||||
@@ -94,7 +94,7 @@ function DetailSDGSDesa() {
|
||||
</Box>
|
||||
|
||||
<Group gap="sm" mt="md">
|
||||
<Tooltip label="Hapus SDGs Desa" withArrow position="top">
|
||||
<Tooltip label="Hapus Sdgs Desa" withArrow position="top">
|
||||
<Button
|
||||
color="red"
|
||||
onClick={() => {
|
||||
@@ -110,10 +110,10 @@ function DetailSDGSDesa() {
|
||||
</Button>
|
||||
</Tooltip>
|
||||
|
||||
<Tooltip label="Edit SDGs Desa" withArrow position="top">
|
||||
<Tooltip label="Edit Sdgs Desa" withArrow position="top">
|
||||
<Button
|
||||
color="green"
|
||||
onClick={() => router.push(`/admin/landing-page/sdgs/${data.id}/edit`)}
|
||||
onClick={() => router.push(`/admin/landing-page/sdgs-desa/${data.id}/edit`)}
|
||||
variant="light"
|
||||
radius="md"
|
||||
size="md"
|
||||
@@ -131,7 +131,7 @@ function DetailSDGSDesa() {
|
||||
opened={modalHapus}
|
||||
onClose={() => setModalHapus(false)}
|
||||
onConfirm={handleHapus}
|
||||
text="Apakah Anda yakin ingin menghapus SDGs Desa ini?"
|
||||
text="Apakah Anda yakin ingin menghapus Sdgs Desa ini?"
|
||||
/>
|
||||
</Box>
|
||||
);
|
||||
@@ -53,7 +53,7 @@ function CreateSDGsDesa() {
|
||||
await stateSDGSDesa.create.create();
|
||||
|
||||
resetForm();
|
||||
router.push("/admin/landing-page/sdgs")
|
||||
router.push("/admin/landing-page/sdgs-desa")
|
||||
}
|
||||
return (
|
||||
<Box px={{ base: 'sm', md: 'lg' }} py="md">
|
||||
@@ -64,7 +64,7 @@ function CreateSDGsDesa() {
|
||||
</Button>
|
||||
</Tooltip>
|
||||
<Title order={4} ml="sm" c="dark">
|
||||
Tambah SDGs Desa
|
||||
Tambah Sdgs Desa
|
||||
</Title>
|
||||
</Group>
|
||||
|
||||
@@ -79,7 +79,7 @@ function CreateSDGsDesa() {
|
||||
<Stack gap="md">
|
||||
<Box>
|
||||
<Text fw="bold" fz="sm" mb={6}>
|
||||
Gambar SDGs Desa
|
||||
Gambar Sdgs Desa
|
||||
</Text>
|
||||
<Dropzone
|
||||
onDrop={(files) => {
|
||||
@@ -143,10 +143,10 @@ function CreateSDGsDesa() {
|
||||
<TextInput
|
||||
label={
|
||||
<Text fw="bold" fz="sm" mb={4}>
|
||||
Nama SDGs Desa
|
||||
Nama Sdgs Desa
|
||||
</Text>
|
||||
}
|
||||
placeholder="Masukkan nama SDGs Desa"
|
||||
placeholder="Masukkan nama Sdgs Desa"
|
||||
value={stateSDGSDesa.create.form.name}
|
||||
onChange={(val) => {
|
||||
stateSDGSDesa.create.form.name = val.target.value;
|
||||
@@ -15,8 +15,8 @@ function SdgsDesa() {
|
||||
return (
|
||||
<Box>
|
||||
<HeaderSearch
|
||||
title='SDGs Desa'
|
||||
placeholder='Cari SDGs Desa...'
|
||||
title='Sdgs Desa'
|
||||
placeholder='Cari Sdgs Desa...'
|
||||
searchIcon={<IconSearch size={20} />}
|
||||
value={search}
|
||||
onChange={(e) => setSearch(e.currentTarget.value)}
|
||||
@@ -58,13 +58,13 @@ function ListSdgsDesa({ search }: { search: string }) {
|
||||
<Box py={10}>
|
||||
<Paper withBorder bg={colors['white-1']} p="lg" shadow="md" radius="md">
|
||||
<Group justify="space-between" mb="md">
|
||||
<Title order={4}>Daftar SDGs Desa</Title>
|
||||
<Tooltip label="Tambah SDGs Desa" withArrow>
|
||||
<Title order={4}>Daftar Sdgs Desa</Title>
|
||||
<Tooltip label="Tambah Sdgs Desa" withArrow>
|
||||
<Button
|
||||
leftSection={<IconPlus size={18} />}
|
||||
color={colors['blue-button']}
|
||||
variant="light"
|
||||
onClick={() => router.push('/admin/landing-page/sdgs/create')}
|
||||
onClick={() => router.push('/admin/landing-page/sdgs-desa/create')}
|
||||
>
|
||||
Tambah Baru
|
||||
</Button>
|
||||
@@ -74,7 +74,7 @@ function ListSdgsDesa({ search }: { search: string }) {
|
||||
<Table>
|
||||
<TableThead>
|
||||
<TableTr>
|
||||
<TableTh style={{ width: '60%' }}>Nama SDGs Desa</TableTh>
|
||||
<TableTh style={{ width: '60%' }}>Nama Sdgs Desa</TableTh>
|
||||
<TableTh style={{ width: '20%' }}>Jumlah</TableTh>
|
||||
<TableTh style={{ width: '20%', textAlign: 'center' }}>Aksi</TableTh>
|
||||
</TableTr>
|
||||
@@ -82,7 +82,7 @@ function ListSdgsDesa({ search }: { search: string }) {
|
||||
<TableTbody>
|
||||
<TableTr>
|
||||
<TableTd colSpan={3} style={{ textAlign: 'center', padding: '2rem' }}>
|
||||
<Text c="dimmed">Tidak ada data SDGs Desa</Text>
|
||||
<Text c="dimmed">Tidak ada data Sdgs Desa</Text>
|
||||
</TableTd>
|
||||
</TableTr>
|
||||
</TableTbody>
|
||||
@@ -97,13 +97,13 @@ function ListSdgsDesa({ search }: { search: string }) {
|
||||
<Box py={10}>
|
||||
<Paper withBorder bg={colors['white-1']} p="lg" shadow="md" radius="md">
|
||||
<Group justify="space-between" mb="md">
|
||||
<Title order={4}>Daftar SDGs Desa</Title>
|
||||
<Tooltip label="Tambah SDGs Desa" withArrow>
|
||||
<Title order={4}>Daftar Sdgs Desa</Title>
|
||||
<Tooltip label="Tambah Sdgs Desa" withArrow>
|
||||
<Button
|
||||
leftSection={<IconPlus size={18} />}
|
||||
color={colors['blue-button']}
|
||||
variant="light"
|
||||
onClick={() => router.push('/admin/landing-page/sdgs/create')}
|
||||
onClick={() => router.push('/admin/landing-page/sdgs-desa/create')}
|
||||
>
|
||||
Tambah Baru
|
||||
</Button>
|
||||
@@ -113,7 +113,7 @@ function ListSdgsDesa({ search }: { search: string }) {
|
||||
<Table highlightOnHover>
|
||||
<TableThead>
|
||||
<TableTr>
|
||||
<TableTh style={{ width: '60%' }}>Nama SDGs Desa</TableTh>
|
||||
<TableTh style={{ width: '60%' }}>Nama Sdgs Desa</TableTh>
|
||||
<TableTh style={{ width: '20%' }}>Jumlah</TableTh>
|
||||
<TableTh style={{ width: '20%', textAlign: 'center' }}>Aksi</TableTh>
|
||||
</TableTr>
|
||||
@@ -137,7 +137,7 @@ function ListSdgsDesa({ search }: { search: string }) {
|
||||
variant="light"
|
||||
color="blue"
|
||||
size="sm"
|
||||
onClick={() => router.push(`/admin/landing-page/sdgs/${item.id}`)}
|
||||
onClick={() => router.push(`/admin/landing-page/sdgs-desa/${item.id}`)}
|
||||
>
|
||||
<IconDeviceImacCog size={18} />
|
||||
</Button>
|
||||
@@ -21,8 +21,8 @@ export const navBar = [
|
||||
},
|
||||
{
|
||||
id: "Landing_Page_4",
|
||||
name: "SDGs Desa",
|
||||
path: "/admin/landing-page/sdgs"
|
||||
name: "Sdgs Desa",
|
||||
path: "/admin/landing-page/sdgs-desa"
|
||||
},
|
||||
{
|
||||
id: "Landing_Page_5",
|
||||
|
||||
Reference in New Issue
Block a user