u
This commit is contained in:
@@ -68,7 +68,7 @@ export default function addImage(pool) {
|
||||
w: processed.thumb.w,
|
||||
h: processed.thumb.h,
|
||||
},
|
||||
hash: processed.full.hash,
|
||||
fullHash: processed.full.hash,
|
||||
thumbHash: processed.thumb.hash,
|
||||
};
|
||||
} catch (err) {
|
||||
|
||||
@@ -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];
|
||||
|
||||
@@ -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];
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user