mirror of
https://github.com/linsa-io/linsa.git
synced 2026-01-12 12:20:23 +01:00
Tasks (#175)
* tasks * task input * fixed jazz things * create new task ui * feat: simple feature flag --------- Co-authored-by: marshennikovaolga <marshennikova@gmail.com> Co-authored-by: Aslam H <iupin5212@gmail.com>
This commit is contained in:
15
web/app/(pages)/tasks/page.tsx
Normal file
15
web/app/(pages)/tasks/page.tsx
Normal file
@@ -0,0 +1,15 @@
|
||||
import { TaskRoute } from "@/components/routes/task/TaskRoute"
|
||||
import { currentUser } from "@clerk/nextjs/server"
|
||||
import { notFound } from "next/navigation"
|
||||
import { get } from "ronin"
|
||||
|
||||
export default async function TaskPage() {
|
||||
const user = await currentUser()
|
||||
const flag = await get.featureFlag.with.name("TASK")
|
||||
|
||||
if (!user?.emailAddresses.some(email => flag?.emails.includes(email.emailAddress))) {
|
||||
notFound()
|
||||
}
|
||||
|
||||
return <TaskRoute />
|
||||
}
|
||||
@@ -10,6 +10,19 @@ import { ZSAError } from "zsa"
|
||||
const MAX_FILE_SIZE = 1 * 1024 * 1024
|
||||
const ALLOWED_FILE_TYPES = ["image/jpeg", "image/png", "image/gif", "image/webp"]
|
||||
|
||||
export const getFeatureFlag = authedProcedure
|
||||
.input(
|
||||
z.object({
|
||||
name: z.string()
|
||||
})
|
||||
)
|
||||
.handler(async ({ input }) => {
|
||||
const { name } = input
|
||||
const flag = await get.featureFlag.with.name(name)
|
||||
|
||||
return { flag }
|
||||
})
|
||||
|
||||
export const sendFeedback = authedProcedure
|
||||
.input(
|
||||
z.object({
|
||||
|
||||
Reference in New Issue
Block a user