style: clean up code formatting and remove trailing whitespace
refactor: reorganize imports and fix type imports
This commit is contained in:
1 parent
d3704602fd
commit
47c04de6fe
232 files changed
+7140
-4798
No files matched your search
@@ -1,7 +1,7 @@
|
||||
"use client";
|
||||
|
||||
import { useState } from "react";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
import { AdminItemForm, type ItemFormPayload } from "./AdminItemForm";
|
||||
|
||||
interface AdminItemCreateViewProps {
|
||||
@@ -10,7 +10,11 @@ interface AdminItemCreateViewProps {
|
||||
serverOptions: string[];
|
||||
}
|
||||
|
||||
export function AdminItemCreateView({ locale, categories, serverOptions }: AdminItemCreateViewProps) {
|
||||
export function AdminItemCreateView({
|
||||
locale,
|
||||
categories,
|
||||
serverOptions,
|
||||
}: AdminItemCreateViewProps) {
|
||||
const router = useRouter();
|
||||
const [submitting, setSubmitting] = useState(false);
|
||||
|
||||
@@ -43,7 +47,9 @@ export function AdminItemCreateView({ locale, categories, serverOptions }: Admin
|
||||
});
|
||||
|
||||
if (!response.ok) {
|
||||
const errorPayload = await response.json().catch(() => ({ error: "Erro ao criar item" }));
|
||||
const errorPayload = await response
|
||||
.json()
|
||||
.catch(() => ({ error: "Erro ao criar item" }));
|
||||
throw new Error(errorPayload?.error || "Falha ao criar item");
|
||||
}
|
||||
|
||||
@@ -75,4 +81,3 @@ export function AdminItemCreateView({ locale, categories, serverOptions }: Admin
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user