Initial Commit
This commit is contained in:
17
src/organization/organization.controller.ts
Normal file
17
src/organization/organization.controller.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { FastifyRequest, FastifyReply } from "fastify";
|
||||
import { CreateOrgInput } from "./organization.schema";
|
||||
import { createOrg } from "./organization.service";
|
||||
|
||||
export async function createOrgHandler(
|
||||
req: FastifyRequest<{ Body: CreateOrgInput }>,
|
||||
res: FastifyReply
|
||||
) {
|
||||
const input = req.body;
|
||||
|
||||
try {
|
||||
const org = await createOrg(input);
|
||||
return res.code(201).send(org);
|
||||
} catch (err) {
|
||||
return err;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user