Skip to content

Commit c0262f7

Browse files
committed
fixed memo appearing in all user search
1 parent ed75e1f commit c0262f7

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

server/src/database/users.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,11 @@ export async function getAllUsers(): Promise<
168168
> {
169169
try {
170170
const users = await prisma.user.findMany({
171+
where: {
172+
NOT: {
173+
id: 0, // exclude memo from all user search results
174+
},
175+
},
171176
include: {
172177
enrollments: {
173178
include: {

server/src/functions/user.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ beforeAll(() => {
1414
test("get all users", async () => {
1515
const result = await getAllUsers();
1616
expect(result.code).toBe(200);
17-
expect(result.body).toSatisfy((s) => s.length === 4);
17+
expect(result.body).toSatisfy((s) => s.length === 3);
1818
expect(result.body).toSatisfy(
1919
(s) =>
2020
typeof s !== "string" && s.some((person) => person.name === "田中太郎"),

0 commit comments

Comments
 (0)