Skip to content

Admin UI works but can't update records #104

@surfer77

Description

@surfer77

I can access /admin and see all my resources but when I edit something and and save it, it gives "There were errors in the record object. Check them out" no matter which record I try to update from different collections (some created only with one field of String for example for testing)

this is my admin.js route

const AdminBro = require("admin-bro");
const AdminBroExpress = require("admin-bro-expressjs");

const AdminBroMongoose = require("admin-bro-mongoose");
const mongoose = require("mongoose");

const User = require("../models/user.js");
const Api = require("../models/api.js");
const Query = require("../models/query.js");
const Company = require("../models/company.js");
const Collection = require("../models/collection.js");
const Comment = require("../models/comment.js");

AdminBro.registerAdapter(AdminBroMongoose);


// Passing resources one by one
const adminBro = new AdminBro({
	resources: [Api, User, Query, Company, Collection, Comment],
	rootPath: "/admin"
});

const router = AdminBroExpress.buildRouter(adminBro);

module.exports = router;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions