Skip to content

Commit

Permalink
Added import of Type SafeResult and added that and queryString and or…
Browse files Browse the repository at this point in the history
…Throw to interface Server.
  • Loading branch information
faddah committed Oct 1, 2024
1 parent b1d09b0 commit 35a29f2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/actions/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { defineAction } from "astro:actions";
import { defineAction, type SafeResult } from "astro:actions";
import { db, Idea } from "astro:db";
import { z } from "astro:content";

Expand All @@ -13,7 +13,9 @@ interface Server {
ideas: {
save: ReturnType<typeof defineAction>;
};
handler: (input: FormData) => Promise<string>;
handler: (input: FormData) => Promise<SafeResult<{ id: number; text: string; good: boolean; }, string>>;
queryString: string;
orThrow: (input: FormData) => Promise<SafeResult<{ id: number; text: string; good: boolean; }, string>>;
}

export const server: Server = {
Expand Down

0 comments on commit 35a29f2

Please sign in to comment.