jwt gen & rename fixes

This commit is contained in:
Julian Krauser 2025-01-22 11:57:19 +01:00
parent 313785b4ac
commit a165231c47
13 changed files with 101 additions and 41 deletions

View file

@ -11,14 +11,14 @@ export default abstract class WebapiPermissionService {
static async getByApi(webapiId: number): Promise<Array<webapiPermission>> {
return await dataSource
.getRepository(webapiPermission)
.createQueryBuilder("api_permission")
.where("api_permission.apiId = :apiId", { apiId: webapiId })
.createQueryBuilder("webapi_permission")
.where("webapi_permission.webapiId = :webapiId", { webapiId: webapiId })
.getMany()
.then((res) => {
return res;
})
.catch((err) => {
throw new InternalException("api permissions not found by api", err);
throw new InternalException("webapi permissions not found by api", err);
});
}
}

View file

@ -70,7 +70,7 @@ export default abstract class WebapiService {
return await dataSource
.getRepository(webapi)
.createQueryBuilder("webapi")
.select("token")
.select("webapi.token")
.where("webapi.id = :id", { id: id })
.getOneOrFail()
.then((res) => {