mirror of
https://github.com/kmc7468/arkvault.git
synced 2026-11-04 00:00:28 +09:00
11 lines
309 B
TypeScript
11 lines
309 B
TypeScript
import { UserRepo } from "#lib/server/db/index.ts";
|
|
import { AppError } from "#lib/server/errors.ts";
|
|
|
|
export const getUser = async (userId: number) => {
|
|
const user = await UserRepo.getUser(userId);
|
|
if (!user) {
|
|
throw new AppError("INTERNAL_SERVER_ERROR", "Invalid session id");
|
|
}
|
|
return user;
|
|
};
|