mirror of
https://github.com/vale981/Vulcan
synced 2025-03-06 10:01:40 -05:00
fix categories mutations (missing import + resolver definition..)
This commit is contained in:
parent
364dacaecf
commit
e563257996
3 changed files with 5 additions and 5 deletions
|
@ -43,7 +43,7 @@ class CategoriesList extends Component {
|
|||
<Modal.Title><FormattedMessage id="categories.edit"/></Modal.Title>
|
||||
</Modal.Header>
|
||||
<Modal.Body>
|
||||
<ContextPasser currentUser={this.context.currentUser} actions={this.context.actions} closeCallback={this.closeModal}>
|
||||
<ContextPasser currentUser={this.context.currentUser} closeCallback={this.closeModal}>
|
||||
<Telescope.components.CategoriesEditForm category={category}/>
|
||||
</ContextPasser>
|
||||
</Modal.Body>
|
||||
|
|
|
@ -16,19 +16,17 @@ const CategoriesNewForm = (props, context) => {
|
|||
resultQuery={Categories.graphQLQueries.single}
|
||||
updateQueries={{
|
||||
getAppData: (prev, {mutationResult}) => {
|
||||
console.log(prev);
|
||||
const newCategory = mutationResult.data.categoriesNew;
|
||||
console.log(newCategory);
|
||||
const newCategoriesList = update(prev, {
|
||||
categories: {
|
||||
$push: [newCategory]
|
||||
}
|
||||
});
|
||||
console.log(newCategoriesList);
|
||||
return newCategoriesList;
|
||||
},
|
||||
}}
|
||||
successCallback={(category)=>{
|
||||
context.closeCallback();
|
||||
props.flash("Category created.", "success");
|
||||
}}
|
||||
/>
|
||||
|
@ -39,6 +37,7 @@ const CategoriesNewForm = (props, context) => {
|
|||
CategoriesNewForm.displayName = "CategoriesNewForm";
|
||||
|
||||
CategoriesNewForm.contextTypes = {
|
||||
closeCallback: React.PropTypes.func,
|
||||
currentUser: React.PropTypes.object,
|
||||
};
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import Telescope from 'meteor/nova:lib';
|
||||
import mutations from './mutations.js';
|
||||
|
||||
export default resolvers = {
|
||||
Post: {
|
||||
|
@ -14,7 +15,6 @@ export default resolvers = {
|
|||
Query: {
|
||||
categories(root, args, context) {
|
||||
const options = {
|
||||
limit: 5,
|
||||
fields: context.getViewableFields(context.currentUser, context.Categories)
|
||||
};
|
||||
return context.Categories.find({}, options).fetch();
|
||||
|
@ -23,6 +23,7 @@ export default resolvers = {
|
|||
return context.Categories.findOne({_id: args._id}, { fields: context.getViewableFields(context.currentUser, context.Categories) });
|
||||
},
|
||||
},
|
||||
Mutation: mutations,
|
||||
};
|
||||
|
||||
Telescope.graphQL.addResolvers(resolvers);
|
Loading…
Add table
Reference in a new issue