fix: org adapter shouldn't use dynamic table names

This commit is contained in:
Bereket Engida
2024-11-19 10:51:47 +03:00
parent 1f67c26782
commit 129ade120c

View File

@@ -70,7 +70,7 @@ export const getOrgAdapter = (
organizationId: string;
}) => {
const user = await adapter.findOne<User>({
model: context.tables.user.modelName,
model: "user",
where: [
{
field: "email",
@@ -126,7 +126,7 @@ export const getOrgAdapter = (
],
}),
await adapter.findOne<User>({
model: context.tables.user.modelName,
model: "user",
where: [
{
field: "id",
@@ -162,7 +162,7 @@ export const getOrgAdapter = (
return null;
}
const user = await adapter.findOne<User>({
model: context.tables.user.modelName,
model: "user",
where: [
{
field: "id",
@@ -268,7 +268,7 @@ export const getOrgAdapter = (
organizationId: string | null,
) => {
const session = await adapter.update<Session>({
model: context.tables.session.modelName,
model: "session",
where: [
{
field: "id",
@@ -316,7 +316,7 @@ export const getOrgAdapter = (
const userIds = members.map((member) => member.userId);
const users = await adapter.findMany<User>({
model: context.tables.user.modelName,
model: "user",
where: [{ field: "id", value: userIds, operator: "in" }],
});