Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
230 views
in Technique[技术] by (71.8m points)

node.js - admin-bro upload feature doesnt show the virtual field

i try to connect to aws from the features of admin-bro ,

but the virtual field not appearing, i dont know what i missing?

i followed this tutorial : https://itnext.io/the-easiest-and-fastest-way-to-upload-files-in-node-js-4b49e0123190 , in his tutorial he just get the virtual field into the frontend. in mine nothing.

   const AdminBro = require("admin-bro");
      const { Admin } = require("./admin.entity");
     const { passwordAfter, passwordBefore } = require("./actions/passHash");
  const uploadFeature = require("@admin-bro/upload");
  /**@type {AdminBro.ResourceOptions} */

   const options = {
properties: {
    encryptedPassword: {
        isVisible: false,
    },
    password: {
        type: "password",
    },
},
features: [
    uploadFeature({
        provider: {
            aws: {
                accessKeyId: process.env.S3_ACCESS_ID,
                secretAccessKey: process.env.S3_SECRET_ACCESS_KEY,
                Bucket: "batkolbucket",
                region: "EU (Paris) eu-west-3",
            },
        },
        properties: {
            file: "virtual",
            key: "uploadedFile.path",
            mimeType: "uploadedFile.type", // this property is important because allows to have 
       previews
            size: "uploadedFile.size",
            filename: "uploadedFile.filename",
        },
    }),
],
actions: {
    new: {
        after: passwordAfter,
        before: passwordBefore,
    },
    edit: {
        after: passwordAfter,
        before: passwordBefore,
    },
},
  };
  module.exports = {
options,
resource: Admin,

};

question from:https://stackoverflow.com/questions/65598662/admin-bro-upload-feature-doesnt-show-the-virtual-field

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...