chore(start): update to alpha and fix editor image removed (#187)

* chore(start): update to alpha and fix editor image removed

* chore: fix image editor
This commit is contained in:
Aslam
2024-11-19 02:22:46 +07:00
committed by GitHub
parent 5e60b2d293
commit e5a0332ec9
19 changed files with 312 additions and 303 deletions

View File

@@ -32,11 +32,12 @@ import { Editor } from "@tiptap/react"
import { createServerFn } from "@tanstack/start"
import { clerkClient, getAuth } from "@clerk/tanstack-start/server"
import { create } from "ronin"
import { getWebRequest } from "vinxi/http"
export const sendFeedbackFn = createServerFn(
"POST",
async (data: { content: string }, { request }) => {
const auth = await getAuth(request)
export const sendFeedbackFn = createServerFn({ method: "POST" })
.validator((content: string) => content)
.handler(async ({ data }) => {
const auth = await getAuth(getWebRequest())
if (!auth.userId) {
throw new Error("User not authenticated")
@@ -46,11 +47,10 @@ export const sendFeedbackFn = createServerFn(
telemetry: { disabled: true },
}).users.getUser(auth.userId)
await create.feedback.with({
message: data.content,
message: data,
emailFrom: user.emailAddresses[0].emailAddress,
})
},
)
})
const formSchema = z.object({
content: z.string().min(1, {
@@ -83,7 +83,7 @@ export function Feedback() {
async function onSubmit(values: z.infer<typeof formSchema>) {
try {
setIsPending(true)
await sendFeedbackFn(values)
await sendFeedbackFn({ data: values.content })
form.reset({ content: "" })
editorRef.current?.commands.clearContent()

View File

@@ -20,7 +20,7 @@ export const JournalSection: React.FC = () => {
setIsFetching(true)
if (isLoaded && isSignedIn) {
const response = await getFeatureFlag({ name: "JOURNAL" })
const response = await getFeatureFlag({ data: "JOURNAL" })
if (
user?.emailAddresses.some((email) =>

View File

@@ -32,7 +32,7 @@ export const TaskSection: React.FC = () => {
setIsFetching(true)
if (isLoaded && isSignedIn) {
const response = await getFeatureFlag({ name: "TASK" })
const response = await getFeatureFlag({ data: "TASK" })
if (
user?.emailAddresses.some((email) =>