add create resource trpc function

This commit is contained in:
Brandon Egger
2023-09-04 00:03:42 -05:00
parent c243fda8e1
commit cd1dc2a555
6 changed files with 82 additions and 58 deletions

View File

@ -42,13 +42,16 @@ const AdminActionButton = ({
label,
onClick,
symbol,
type = "button",
}: {
label: string;
onClick: () => void;
onClick?: () => void;
symbol: JSX.Element | undefined;
type?: HTMLButtonElement["type"];
}) => {
return (
<button
type={type}
className="py-auto group my-auto h-full space-x-2 rounded-lg border border-neutral-400 bg-neutral-800 px-2 hover:border-neutral-800 hover:bg-white"
onClick={onClick}
>

View File

@ -47,6 +47,7 @@ import { ResourcePhoto } from "~/components/ResourcePhoto";
Modal.setAppElement("#__next");
export type ResourceUpdateInput = RouterInputs["auditoryResource"]["update"];
export type ResourceCreateInput = RouterInputs["auditoryResource"]["create"];
/**
* Renders the image selector for resource form.
@ -361,14 +362,14 @@ function ResourceSummarySubForm({
<InfoInputLine
details={register("manufacturer.name", { required: true })}
placeholder="manufacturer"
value={resource?.manufacturer?.name ?? ""}
hint="manufacturer"
value={resource?.name}
/>
</span>
<InfoInputLine
details={register("name", { required: true })}
placeholder="name"
value={resource?.name ?? ""}
value={resource?.name}
hint="name"
/>
<span className="my-1 block w-full text-center text-xs italic text-neutral-400">