Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: edit page does not shows the files I uploaded previously #1626

Open
harshagr64 opened this issue Feb 12, 2024 · 5 comments
Open

[Bug]: edit page does not shows the files I uploaded previously #1626

harshagr64 opened this issue Feb 12, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@harshagr64
Copy link

Contact Details

No response

What happened?

[Bug]: edit page does not shows the files I uploaded previously

Bug prevalence

4

AdminJS dependencies version

7.2.0

What browsers do you see the problem on?

No response

Relevant log output

No response

Relevant code that's giving you issues

No response

@harshagr64 harshagr64 added the bug Something isn't working label Feb 12, 2024
@dziraf
Copy link
Contributor

dziraf commented Feb 12, 2024

Please share more information. Your description isn't very helpful.

@harshagr64
Copy link
Author

I am uploading multiple files to my admin js dashboard using upload library of admin js, now It gets uploaded successfully and file path gets stored in databse as an array, but when I try to edit that page, these uploaded files does not shows up.

`import mongoose, { trusted } from "mongoose";

const propertySchema = new mongoose.Schema({
colony_id: {
type: mongoose.Schema.Types.ObjectId,
ref: "Colony",
},
number: {
type: Number,
required: true,
},
name: {
type: String,
required: true,
},
images: [String],
size: {
type: String,
required: true,
},
location: {
type: String,
required: true,
},
pincode: {
type: mongoose.Schema.Types.ObjectId,
ref: "MasterPincode",
},
building: {
type: mongoose.Schema.Types.ObjectId,
ref: "Building",
},
isavailable: {
type: Boolean,
required: true,
default: true,
},
type: {
type: String,
required: true,
enum: ["Plot", "Flat", "Villa"],
},
description: String,
Bhk: {
type: Number,
// required: true,
},
flats: {
type: String,
description: "No of Flats Available in Building (if type is flat)",
// min: 0,
// required: true,
},
price: {
type: Number,
required: true,
},
created_at: {
type: Date,
default: Date.now(),
},
updated_at: {
type: Date,
default: Date.now(),
},
});

export default mongoose.model("Property", propertySchema);`

This is the model I am using and images is the key in which I am storing the paths of the files. FIles are getting stored locally on system

@harshagr64
Copy link
Author

@dziraf can you help me with this problem?

@eladvider
Copy link

I am encountering an issue where, despite successfully uploading multiple image properties, I am unable to view the previously uploaded images in edit mode.
While they are visible on the show page, they do not appear during the editing process.

@eladvider
Copy link

@dziraf
im using S3 Provider
I think that the bug is with the strip-payload-factory in the follwing code:
filteredPayload = flat.filterOutParams(filteredPayload, properties.filePath)

becose that in the UpladEditComponent we have the follwing condiation: {custom.multiple && key && key.length && path ?

when path is

const path = flat.get(params, custom.filePathProperty)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants