diff --git a/apps/envited.ascs.digital/common/database/queries/users.ts b/apps/envited.ascs.digital/common/database/queries/users.ts index 5d459221..678c046c 100644 --- a/apps/envited.ascs.digital/common/database/queries/users.ts +++ b/apps/envited.ascs.digital/common/database/queries/users.ts @@ -1,4 +1,4 @@ -import { ExtractTablesWithRelations, and, eq, inArray } from 'drizzle-orm' +import { ExtractTablesWithRelations, eq, inArray } from 'drizzle-orm' import { PgTransaction } from 'drizzle-orm/pg-core' import { PostgresJsDatabase } from 'drizzle-orm/postgres-js' import { PostgresJsQueryResultHKT } from 'drizzle-orm/postgres-js' @@ -19,11 +19,11 @@ import { } from '../schema' import { Credential, DatabaseConnection, Issuer, User } from '../types' -export const deleteUserById = (db: DatabaseConnection) => async (id: string, issuerId: string) => +export const deleteUserById = (db: DatabaseConnection) => async (id: string) => db .update(user) .set({ isActive: false, updatedAt: new Date() }) - .where(and(eq(user.id, id), eq(user.issuerId, issuerId))) + .where(eq(user.id, id)) .returning({ updatedId: user.id }) export const getUserById = (db: DatabaseConnection) => async (id: string) => diff --git a/apps/envited.ascs.digital/common/serverActions/users/deleteUserById.ts b/apps/envited.ascs.digital/common/serverActions/users/deleteUserById.ts index 576a6fb9..042b6a0b 100644 --- a/apps/envited.ascs.digital/common/serverActions/users/deleteUserById.ts +++ b/apps/envited.ascs.digital/common/serverActions/users/deleteUserById.ts @@ -26,7 +26,7 @@ export const _deleteUserById = throw badRequestError('Incorrect permissions') } - const [deletedUser] = await connection.deleteUserById(user.id, user.issuerId) + const [deletedUser] = await connection.deleteUserById(user.id) return deletedUser } catch (e) {