Feature/hardcoded mypages links * feat: wip use hardcoded links * Merge branch 'master' of bitbucket.org:scandic-swap/web into feature/hardcoded-mypages-links * feat: use hardcoded links for my pages to support dynamic links * cleanup * code fixes * refactor: restructure MyPagesMobileDropdown component for improved readability * use util timeout function Approved-by: Christian Andolf Approved-by: Linus Flood
28 lines
591 B
TypeScript
28 lines
591 B
TypeScript
import { TRPCError } from "@trpc/server"
|
|
import { z } from "zod"
|
|
|
|
import { protectedProcedure } from "@/server/trpc"
|
|
|
|
import { timeout } from "@/utils/timeout"
|
|
|
|
const outputSchema = z.object({
|
|
// unlinked: z.boolean(),
|
|
})
|
|
|
|
export const unlinkAccount = protectedProcedure
|
|
.output(outputSchema)
|
|
.mutation(async function ({ ctx, input }) {
|
|
console.log("[SAS] unlink account")
|
|
await timeout(1000)
|
|
//TODO: Call actual API here
|
|
|
|
throw new TRPCError({
|
|
message: "Unable to unlink account",
|
|
code: "BAD_REQUEST",
|
|
})
|
|
|
|
return {
|
|
unlinked: true,
|
|
}
|
|
})
|