upd:
Deskripsi: - update version api - hapus button test web push No Issues
This commit is contained in:
@@ -2,7 +2,7 @@ import { NextResponse } from "next/server";
|
|||||||
|
|
||||||
export async function GET(request: Request) {
|
export async function GET(request: Request) {
|
||||||
try {
|
try {
|
||||||
return NextResponse.json({ success: true, version: "0.2.2", mode: "staging" }, { status: 200 });
|
return NextResponse.json({ success: true, version: "0.2.3", mode: "staging" }, { status: 200 });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
return NextResponse.json({ success: false, version: "Gagal mendapatkan version, coba lagi nanti (error: 500)", reason: (error as Error).message, }, { status: 500 });
|
return NextResponse.json({ success: false, version: "Gagal mendapatkan version, coba lagi nanti (error: 500)", reason: (error as Error).message, }, { status: 500 });
|
||||||
|
|||||||
@@ -16,23 +16,6 @@ export default function ViewDetailFeature() {
|
|||||||
const isMobile = useMediaQuery('(max-width: 369px)');
|
const isMobile = useMediaQuery('(max-width: 369px)');
|
||||||
const tema = useHookstate(TEMA)
|
const tema = useHookstate(TEMA)
|
||||||
|
|
||||||
async function onKirim() {
|
|
||||||
try {
|
|
||||||
const res = await fetch('/api/push-notification', {
|
|
||||||
method: 'PUT',
|
|
||||||
})
|
|
||||||
|
|
||||||
const dataText = await res.text()
|
|
||||||
if (!res.ok) {
|
|
||||||
alert(dataText)
|
|
||||||
throw new Error(dataText)
|
|
||||||
}
|
|
||||||
alert("berhasil kirim")
|
|
||||||
} catch (error) {
|
|
||||||
console.error(error);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<LayoutNavbarNew back='/home' title='Fitur' menu={<></>} />
|
<LayoutNavbarNew back='/home' title='Fitur' menu={<></>} />
|
||||||
@@ -174,25 +157,6 @@ export default function ViewDetailFeature() {
|
|||||||
</Box>
|
</Box>
|
||||||
</>
|
</>
|
||||||
}
|
}
|
||||||
|
|
||||||
{/* DELETE SOON */}
|
|
||||||
<Box onClick={() => { onKirim() }}>
|
|
||||||
<Center>
|
|
||||||
<ActionIcon variant="gradient"
|
|
||||||
size={isMobile ? 50 : 68}
|
|
||||||
aria-label="Gradient action icon"
|
|
||||||
radius={100}
|
|
||||||
// gradient={{ from: '#DFDA7C', to: '#F2AF46', deg: 174 }}
|
|
||||||
bg={tema.get().bgFiturHome}
|
|
||||||
>
|
|
||||||
<RiLayoutTop2Fill size={isMobile ? 25 : 35} color={tema.get().utama} />
|
|
||||||
</ActionIcon>
|
|
||||||
</Center>
|
|
||||||
<Center>
|
|
||||||
<Text fz={isMobile ? 13 : 15} c={tema.get().utama}>Kirim Notifikasi</Text>
|
|
||||||
</Center>
|
|
||||||
</Box>
|
|
||||||
|
|
||||||
</SimpleGrid>
|
</SimpleGrid>
|
||||||
</Box>
|
</Box>
|
||||||
</Box>
|
</Box>
|
||||||
|
|||||||
Reference in New Issue
Block a user