Feature(s) impacted
Smart Action fails when attempting to upload an image.
Observed behavior
UI pops up saying Unexpected Error with Action. No console logs from local server or in browser.
If I upload a .txt file or .pdf, works fine.
Expected behavior
Error logs out somewhere or image is successfully uploaded.
Context
Running from a localhost server with the following code. Hopefully leading to uploading to an aws server
Collection code
collection("questionImage", {
actions: [
{
name: "Coool Action",
type: "global",
fields: [
{
field: "imageTitle",
isRequired: true,
description: "The title of the image you want to upload",
type: "String",
},
{
field: "image",
isRequired: true,
description: "Image you need",
type: "File",
},
],
},
],
fields: [
{
field: "small_image_url",
type: "String",
get: (questionImage) => {
return questionImage.imageUrl + "/small.png";
},
},
],
segments: [],
});
Router code
router.post("/actions/coool-action", permissionMiddlewareCreator.smartAction(), (req, res) => {
const attrs = req.body.data.attributes.values;
const imageTitle = attrs["imageTitle"];
const image = attrs["image"];
res.send({ success: `Coool action has been done! ${imageTitle} ${image}` });
});
- Project name: PlayED
- Team name: Operations
- Environment name: development
- Agent type & version: Admin
- Recent changes made on your end if any: none to my knowledge