Hi, my profile editing works and i’m using react-select for that but the problem is after i choose the values afterwards when i come to edit the profile again the name of the values are not displayed (but they are successfuly stored into my mongodb), instead they are displayed like an empty string with an X sign just like on the picture?
The code doesn’t even compile though, it just breaks, so it’s not really possible to test what’s wrong unless you’ve made some obvious syntax error (I’m on a phone so not even possible to see that).
Yes it is, you know what your API looks like so just replace the functions with ones that directly return what you expect the values to be, for example:
const myDb = {}
let id = 0;
function whateverTheFunctionThatSavingDataIsCalled(data) {
const entry = { id, data };
myDb[id] = entry;
id++;
return entry;
}
function whateverTheFunctionForGetEntryIsCalled(id) {
return myDb[id];
}
function whateverTheFunctionForGetEntriesIsCalled() {
return Object.values(myDb);
}