Initial for #123
This commit is contained in:
@@ -586,6 +586,9 @@ export default async function resourceRoutes(server: FastifyInstance) {
|
||||
try {
|
||||
if (!req.user?.tenant_id) return reply.code(400).send({ error: "No tenant selected" });
|
||||
const { resource } = req.params as { resource: string };
|
||||
if (resource === "accounts") {
|
||||
return reply.code(403).send({ error: "Accounts are read-only" })
|
||||
}
|
||||
const body = req.body as Record<string, any>;
|
||||
const config = resourceConfig[resource];
|
||||
const table = config.table;
|
||||
@@ -656,6 +659,9 @@ export default async function resourceRoutes(server: FastifyInstance) {
|
||||
server.put("/resource/:resource/:id", async (req, reply) => {
|
||||
try {
|
||||
const { resource, id } = req.params as { resource: string; id: string }
|
||||
if (resource === "accounts") {
|
||||
return reply.code(403).send({ error: "Accounts are read-only" })
|
||||
}
|
||||
const body = req.body as Record<string, any>
|
||||
const tenantId = req.user?.tenant_id
|
||||
const userId = req.user?.user_id
|
||||
|
||||
Reference in New Issue
Block a user