Small refactors

This commit is contained in:
Jesse Wierzbinski 2023-09-26 12:33:43 -10:00
parent 2cadb68a56
commit 3b452d66aa
22 changed files with 165 additions and 76 deletions

View file

@ -1,20 +0,0 @@
import { Token } from "~database/entities/Token";
export const getUserByToken = async (access_token: string | null) => {
if (!access_token) return null;
const token = await Token.findOne({
where: {
access_token,
},
relations: {
user: {
relationships: true,
},
},
});
if (!token) return null;
return token.user;
};