Having an issue while trying to insert a document into my meteor collection using an autoform generated from my Mongo schema. Upon clicking the submit button, I am encountering a "method not found [404]" error in the developer console. I suspect the problem lies in the following code snippet:
GameList.allow({
insert: function(userId, doc){
return !!userId;
}
});
This code snippet essentially permits users to add documents to the database only if they are logged in. If I remove this code, I will encounter a "not authorized [403]" error due to the removal of the insecure package from my meteor application. Any insights on what might be triggering this "method not found" error?
Autoform snippet:
{{> quickForm collection="GameList" id="insertGameForm" type="insert" class="newGameForm"}}
Schema used for autoform:
GameListSchema = new SimpleSchema({
title: {
type: String,
label: "Title"
},
platform: {
type: String,
label: "Platform"
},
category: {
type: String,
label: "Category"
},
gameRank: {
type: String,
label: "GameRank"
},
auth: {
type: String,
label: "Author",
autoValue: function(){
return this.userId
},
autoform: {
type: "hidden"
}
}
});
GameList.attachSchema(GameListSchema);