platforms icon indicating copy to clipboard operation
platforms copied to clipboard

imageBlurhash is set to null by updatePost when image missing

Open AustenLamacraft opened this issue 1 year ago • 0 comments

If you edit a post and trigger updatePost then the data sent

      data: {
        title,
        description,
        content,
        slug,
        image,
        imageBlurhash: await getBlurDataURL(image),
        published,
      }

has no image so imageBlurhash ends up being null and gets updated accordingly, causing an error. I found that

      data: {
        title,
        description,
        content,
        slug,
        image,
        imageBlurhash: (await getBlurDataURL(image)) ?? undefined,
        published,
      }

fixes the problem

AustenLamacraft avatar Sep 22 '22 17:09 AustenLamacraft