-
Notifications
You must be signed in to change notification settings - Fork 509
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
2,300 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
apps/dashboard/src/actions/invoice/update-invoice-settings-action.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
"use server"; | ||
|
||
import { authActionClient } from "@/actions/safe-action"; | ||
import { updateInvoiceSettingsSchema } from "./schema"; | ||
|
||
export const updateInvoiceSettingsAction = authActionClient | ||
.metadata({ | ||
name: "update-invoice-settings", | ||
}) | ||
.schema(updateInvoiceSettingsSchema) | ||
.action(async ({ parsedInput: setting, ctx: { user, supabase } }) => { | ||
const teamId = user.team_id; | ||
|
||
const { data, error } = await supabase | ||
.rpc("update_team_setting", { | ||
team_id: teamId, | ||
setting_key: "invoice", | ||
setting_path: [setting], | ||
new_value: setting, | ||
create_missing: true, | ||
}) | ||
.select("*") | ||
.single(); | ||
|
||
console.log(data, error); | ||
|
||
return data; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,7 @@ | ||
"use client"; | ||
|
||
import { Button } from "@midday/ui/button"; | ||
import { useFormContext } from "react-hook-form"; | ||
import type { InvoiceFormValues } from "./schema"; | ||
|
||
export function CreateButton() { | ||
const { handleSubmit } = useFormContext<InvoiceFormValues>(); | ||
|
||
const onSubmit = handleSubmit((data) => { | ||
// Handle form submission | ||
console.log(data); | ||
}); | ||
|
||
return <Button onClick={onSubmit}>Create</Button>; | ||
return <Button>Create</Button>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.