Revert "Merge branch 'canary' into kucherenko/canary"

This reverts commit 819822f30b, reversing
changes made to bda9b05134.
This commit is contained in:
Mauricio Siu
2025-03-02 00:26:59 -06:00
parent 819822f30b
commit e6cb6454db
639 changed files with 17202 additions and 82902 deletions

View File

@@ -12,14 +12,14 @@ export type Registry = typeof registry.$inferSelect;
export const createRegistry = async (
input: typeof apiCreateRegistry._type,
organizationId: string,
adminId: string,
) => {
return await db.transaction(async (tx) => {
const newRegistry = await tx
.insert(registry)
.values({
...input,
organizationId: organizationId,
adminId: adminId,
})
.returning()
.then((value) => value[0]);
@@ -112,11 +112,9 @@ export const updateRegistry = async (
return response;
} catch (error) {
const message =
error instanceof Error ? error.message : "Error updating this registry";
throw new TRPCError({
code: "BAD_REQUEST",
message,
message: "Error updating this registry",
});
}
};
@@ -137,11 +135,9 @@ export const findRegistryById = async (registryId: string) => {
return registryResponse;
};
export const findAllRegistryByOrganizationId = async (
organizationId: string,
) => {
export const findAllRegistryByAdminId = async (adminId: string) => {
const registryResponse = await db.query.registry.findMany({
where: eq(registry.organizationId, organizationId),
where: eq(registry.adminId, adminId),
});
return registryResponse;
};