refactor: SchemaNewExecution definition
This commit is contained in:
parent
6c338e447e
commit
29d092aaac
8 changed files with 12 additions and 22 deletions
src/routes/(app)/entry/[id]
|
@ -7,7 +7,7 @@ import { ZUrlEntityId } from "$lib/shared/model/validation";
|
|||
import { trpc } from "$lib/shared/trpc";
|
||||
import { loadWrap, moveEntryTodoDate } from "$lib/shared/util";
|
||||
|
||||
import { SchemaNewExecution } from "./editExecution/schema";
|
||||
import { SchemaNewExecution } from "./schema";
|
||||
|
||||
export const actions: Actions = {
|
||||
default: async (event) => loadWrap(async () => {
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
import EntryTodoButton from "$lib/components/ui/EntryTodoButton.svelte";
|
||||
import MarkdownInput from "$lib/components/ui/markdown/MarkdownInput.svelte";
|
||||
|
||||
import { SchemaNewExecution } from "./editExecution/schema";
|
||||
import { SchemaNewExecution } from "./schema";
|
||||
|
||||
export let data: PageData;
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ import { ZUrlEntityId } from "$lib/shared/model/validation";
|
|||
import { trpc } from "$lib/shared/trpc";
|
||||
import { loadWrap } from "$lib/shared/util";
|
||||
|
||||
import { SchemaNewExecution } from "./editExecution/schema";
|
||||
import { SchemaNewExecution } from "./schema";
|
||||
|
||||
export const load: PageLoad = async (event) => {
|
||||
const entry = await loadWrap(async () => {
|
||||
|
|
|
@ -7,7 +7,7 @@ import { ZUrlEntityId } from "$lib/shared/model/validation";
|
|||
import { trpc } from "$lib/shared/trpc";
|
||||
import { loadWrap, moveEntryTodoDate } from "$lib/shared/util";
|
||||
|
||||
import { SchemaNewExecution } from "./schema";
|
||||
import { SchemaNewExecution } from "../schema";
|
||||
|
||||
export const actions: Actions = {
|
||||
default: async (event) => loadWrap(async () => {
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
import EntryTodoButton from "$lib/components/ui/EntryTodoButton.svelte";
|
||||
import MarkdownInput from "$lib/components/ui/markdown/MarkdownInput.svelte";
|
||||
|
||||
import { SchemaNewExecution } from "./schema";
|
||||
import { SchemaNewExecution } from "../schema";
|
||||
|
||||
export let data: PageData;
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ import { ZUrlEntityId } from "$lib/shared/model/validation";
|
|||
import { trpc } from "$lib/shared/trpc";
|
||||
import { loadWrap } from "$lib/shared/util";
|
||||
|
||||
import { SchemaNewExecution } from "./schema";
|
||||
import { SchemaNewExecution } from "../schema";
|
||||
|
||||
export const load: PageLoad = async (event) => {
|
||||
const entry = await loadWrap(async () => {
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
import { zod } from "sveltekit-superforms/adapters";
|
||||
|
||||
import { ZEntryExecutionNew, fields } from "$lib/shared/model/validation";
|
||||
|
||||
export const SchemaNewExecution = zod(
|
||||
ZEntryExecutionNew.extend({
|
||||
old_execution_id: fields.EntityId().optional(),
|
||||
}),
|
||||
);
|
|
@ -1,10 +1,9 @@
|
|||
import { zod } from "sveltekit-superforms/adapters";
|
||||
import { z } from "zod";
|
||||
|
||||
import { fields } from "$lib/shared/model/validation";
|
||||
import { ZEntryExecutionNew, fields } from "$lib/shared/model/validation";
|
||||
|
||||
const ZEntryDone = z.object({
|
||||
text: fields.TextString(),
|
||||
});
|
||||
|
||||
export const SchemaEntryExecution = zod(ZEntryDone);
|
||||
export const SchemaNewExecution = zod(
|
||||
ZEntryExecutionNew.extend({
|
||||
old_execution_id: fields.EntityId().optional(),
|
||||
}),
|
||||
);
|
||||
|
|
Loading…
Add table
Reference in a new issue