Fix thumbnail for Photo
This commit is contained in:
@@ -3,13 +3,13 @@ import { print } from "graphql";
|
||||
import getPhotos from '@/graphql/photos/getPhotos.graphql';
|
||||
import md5 from "md5";
|
||||
|
||||
export async function getPhotoFromHash(albumUrl: string, hash: string): Promise<PhotoAlbumPhoto | null> {
|
||||
export async function getPhotoFromHash(albumUrl: string, hash: string): Promise<PhotoAlbumItem | null> {
|
||||
const client = await createDirectusConnection();
|
||||
const result = await client.query(print(getPhotos), {
|
||||
albumUrl: albumUrl
|
||||
});
|
||||
|
||||
let object: PhotoAlbumPhoto | null = null;
|
||||
let object: PhotoAlbumItem | null = null;
|
||||
|
||||
result["Photo_Albums"][0]["photos"].forEach((photo: any) => {
|
||||
/*
|
||||
@@ -29,9 +29,13 @@ export async function getPhotoFromHash(albumUrl: string, hash: string): Promise<
|
||||
id: photo.id,
|
||||
text: photo.text,
|
||||
photo: {
|
||||
url: photo.photo.url,
|
||||
url: photo.photo.filename_disk,
|
||||
width: photo.photo.width,
|
||||
height: photo.photo.height
|
||||
},
|
||||
album: {
|
||||
url: result["Photo_Albums"][0].url,
|
||||
title: result["Photo_Albums"][0].title
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user