mirror of
https://github.com/leaningtech/javafiddle.git
synced 2025-09-06 22:15:28 +00:00
make updated field optional
This commit is contained in:
@@ -7,7 +7,7 @@ const fiddle = z.object({
|
||||
content: z.string(),
|
||||
})),
|
||||
title: z.string(),
|
||||
updated: z.coerce.date(),
|
||||
updated: z.coerce.date().optional(),
|
||||
});
|
||||
|
||||
export type Fiddle = z.infer<typeof fiddle>;
|
||||
|
@@ -28,7 +28,7 @@ export const selectedFilePath = writable<string>("Main.java");
|
||||
export const isSidebarOpen = persist(writable(true), createLocalStorage(), "isSidebarOpen");
|
||||
|
||||
export const fiddleTitle = writable<string>("");
|
||||
export const fiddleUpdated = writable<Date>(new Date);
|
||||
export const fiddleUpdated = writable<Date | undefined>();
|
||||
|
||||
export const favourites = persist(writable<Fiddle[]>([]), createIndexedDBStorage(), "favourites")
|
||||
|
||||
|
@@ -5,7 +5,6 @@ export async function load({ params: { id } }): Promise<{ fiddle: Fiddle, isDefa
|
||||
return {
|
||||
fiddle: {
|
||||
title: "",
|
||||
updated: new Date,
|
||||
files: [
|
||||
{
|
||||
path: "Main.java",
|
||||
|
Reference in New Issue
Block a user