fix: post images with as correct arraybuffer to marka
This commit is contained in:
@@ -17,9 +17,9 @@ export async function createResource(
|
||||
path: string,
|
||||
content: string | object | ArrayBuffer,
|
||||
) {
|
||||
const isJson = typeof content === "object";
|
||||
const isJson = typeof content === "object" &&
|
||||
!(content instanceof ArrayBuffer);
|
||||
const fetchUrl = `${url}/${path}`;
|
||||
console.log("Creating resource", { fetchUrl, content, isJson });
|
||||
const response = await fetch(fetchUrl, {
|
||||
method: "POST",
|
||||
headers: {
|
||||
|
||||
@@ -37,7 +37,6 @@ export const handler: Handlers = {
|
||||
if (posterPath) {
|
||||
const poster = await tmdb.getMoviePoster(posterPath);
|
||||
const extension = fileExtension(posterPath);
|
||||
|
||||
finalPath = `movies/images/${safeFileName(name)}_cover.${extension}`;
|
||||
await createResource(finalPath, poster);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user