This commit is contained in:
seb
2026-08-01 01:59:05 +02:00
parent a05a4791d6
commit 59c874144b
6 changed files with 36 additions and 25 deletions

View File

@@ -4,12 +4,12 @@ import resolvePicAccess from './resolvePicAccess.js';
export default function getImageByHash(pool) {
const authorize = resolvePicAccess(pool);
return async (googleAuthId, hash) => {
await authorize(googleAuthId, hash);
return async (googleAuthId, fullHash) => {
await authorize(googleAuthId, fullHash);
const result = await pool
.request()
.input('hash', hash)
.input('hash', fullHash)
.query(GET_FULL_BY_HASH);
const row = result.recordset[0];

View File

@@ -4,12 +4,12 @@ import resolvePicAccess from './resolvePicAccess.js';
export default function getThumbByHash(pool) {
const authorize = resolvePicAccess(pool);
return async (googleAuthId, hash) => {
await authorize(googleAuthId, hash);
return async (googleAuthId, fullHash) => {
await authorize(googleAuthId, fullHash);
const result = await pool
.request()
.input('hash', hash)
.input('hash', fullHash)
.query(GET_THUMB_BY_HASH);
const row = result.recordset[0];

View File

@@ -4,10 +4,10 @@ import resolveCategoryAccess from '../category/resolveCategoryAccess.js';
export default function resolvePicAccess(pool) {
const access = resolveCategoryAccess(pool);
return async (googleAuthId, hash) => {
return async (googleAuthId, fullHash) => {
const result = await pool
.request()
.input('hash', hash)
.input('hash', fullHash)
.query(GET_CATEGORY_ID_BY_HASH);
const categoryId = result.recordset[0]?.categoryId;