feat: user preferences (#470)
* wip: improve user preferences * wip: fix translations and add user danger zone * feat: add user delete button to danger zone * fix: test not working * refactor: add access checks for user edit page, improve not found behaviour, change user preference link in avatar menu to correct link * fix: remove invalid bg for container * chore: address pull request feedback
This commit is contained in:
12
apps/nextjs/src/errors/trpc-not-found.ts
Normal file
12
apps/nextjs/src/errors/trpc-not-found.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import "server-only";
|
||||
|
||||
import { notFound } from "next/navigation";
|
||||
import { TRPCError } from "@trpc/server";
|
||||
|
||||
export const catchTrpcNotFound = (err: unknown) => {
|
||||
if (err instanceof TRPCError && err.code === "NOT_FOUND") {
|
||||
notFound();
|
||||
}
|
||||
|
||||
throw err;
|
||||
};
|
||||
Reference in New Issue
Block a user