Changes all documents to have an explicit type
This commit is contained in:
@@ -10,10 +10,7 @@ export const LocationEditForm = ({ location }: { location: Location }) => {
|
||||
await pb.collection("documents").update(location.id, {
|
||||
data: {
|
||||
...location.data,
|
||||
location: {
|
||||
...location.data.location,
|
||||
name,
|
||||
},
|
||||
name,
|
||||
},
|
||||
});
|
||||
}
|
||||
@@ -22,10 +19,7 @@ export const LocationEditForm = ({ location }: { location: Location }) => {
|
||||
await pb.collection("documents").update(location.id, {
|
||||
data: {
|
||||
...location.data,
|
||||
location: {
|
||||
...location.data.location,
|
||||
description,
|
||||
},
|
||||
description,
|
||||
},
|
||||
});
|
||||
}
|
||||
@@ -34,11 +28,11 @@ export const LocationEditForm = ({ location }: { location: Location }) => {
|
||||
<div className="">
|
||||
<AutoSaveTextarea
|
||||
multiline={false}
|
||||
value={location.data.location.name}
|
||||
value={location.data.name}
|
||||
onSave={saveLocationName}
|
||||
/>
|
||||
<AutoSaveTextarea
|
||||
value={location.data.location.description}
|
||||
value={location.data.description}
|
||||
onSave={saveLocationDescription}
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -6,8 +6,8 @@ import type { Location } from "@/lib/types";
|
||||
export const LocationPrintRow = ({ location }: { location: Location }) => {
|
||||
return (
|
||||
<li>
|
||||
<h4>{location.data.location.name}</h4>
|
||||
<p>{location.data.location.description}</p>
|
||||
<h4>{location.data.name}</h4>
|
||||
<p>{location.data.description}</p>
|
||||
</li>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -25,11 +25,10 @@ export const NewLocationForm = ({
|
||||
try {
|
||||
const locationDoc: Location = await pb.collection("documents").create({
|
||||
campaign,
|
||||
type: "location",
|
||||
data: {
|
||||
location: {
|
||||
name,
|
||||
description,
|
||||
},
|
||||
name,
|
||||
description,
|
||||
},
|
||||
});
|
||||
setName("");
|
||||
|
||||
Reference in New Issue
Block a user