Moves editing into forms. Every doc has a page now. BUG: state not refreshed after mutation

This commit is contained in:
2025-06-13 16:58:26 -07:00
parent 293e1f9f62
commit ad8fb07c69
14 changed files with 313 additions and 59 deletions

View File

@@ -48,12 +48,32 @@ export type DocumentData<K extends string, V> = {
export type Document = RecordModel & {
id: DocumentId;
campaign: CampaignId;
data: {};
data: {
[K in DocumentType]?: unknown;
};
// These two are not in Pocketbase's types, but they seem to always be present
created: ISO8601Date;
updated: ISO8601Date;
};
export type DocumentType =
| "location"
| "monster"
| "npc"
| "scene"
| "secret"
| "session"
| "treasure";
export type AnyDocument =
| Location
| Monster
| Npc
| Scene
| Secret
| Session
| Treasure;
/** Locations **/
export type Location = Document &