fix domain creation not returning domain data

This commit is contained in:
Max Degterev
2024-09-19 23:01:24 +02:00
parent 65a70c09c1
commit c8f990d541
2 changed files with 4 additions and 2 deletions

View File

@@ -27,7 +27,7 @@ export const domainRouter = createTRPCRouter({
.input(apiCreateDomain)
.mutation(async ({ input }) => {
try {
await createDomain(input);
return await createDomain(input);
} catch (error) {
throw new TRPCError({
code: "BAD_REQUEST",

View File

@@ -26,7 +26,7 @@ export const createDomain = async (input: typeof apiCreateDomain._type) => {
if (!domain) {
throw new TRPCError({
code: "BAD_REQUEST",
message: "Error to create the domain",
message: "Error creating domain",
});
}
@@ -34,6 +34,8 @@ export const createDomain = async (input: typeof apiCreateDomain._type) => {
const application = await findApplicationById(domain.applicationId);
await manageDomain(application, domain);
}
return domain;
});
};