Commit 6b9aa03c authored by Curtis Adam's avatar Curtis Adam

After creating a deck, go directly to the newly created deck (new card)

parent 1d15b695
......@@ -255,7 +255,14 @@ Meteor.methods({
if (!Meteor.userId() || Roles.userIsInRole(this.userId, ["firstLogin", "blocked"])) {
throw new Meteor.Error("not-authorized");
}
Cardsets.insert({
Experience.insert({
type: 2,
value: 3,
date: new Date(),
owner: Meteor.userId()
});
Meteor.call('checkLvl');
return Cardsets.insert({
name: name.trim(),
description: description,
date: new Date(),
......@@ -294,13 +301,6 @@ Meteor.methods({
shuffled: shuffled,
cardGroups: cardGroups
});
Experience.insert({
type: 2,
value: 3,
date: new Date(),
owner: Meteor.userId()
});
Meteor.call('checkLvl');
},
/**
* Delete selected Cardset from database if user is auhorized.
......
......@@ -277,16 +277,19 @@ export function saveCardset() {
}
if (courseIterationRoute()) {
Meteor.call("addCourseIteration", name, description, false, true, 'personal', Session.get('moduleActive'), module, moduleShort, moduleNum, moduleLink, college, course);
$('#setCardsetCourseIterationFormModal').modal('hide');
} else {
Meteor.call("addCardset", name, description, false, true, 'personal', Session.get('moduleActive'), module, moduleShort, moduleNum, moduleLink, college, course, shuffled, cardGroups);
Meteor.call("addCardset", name, description, false, true, 'personal', Session.get('moduleActive'), module, moduleShort, moduleNum, moduleLink, college, course, shuffled, cardGroups, function (error, result) {
$('#setCardsetCourseIterationFormModal').modal('hide');
if (result) {
$('#setCardsetCourseIterationFormModal').on('hidden.bs.modal', function () {
Router.go('cardsetdetailsid', {
_id: result
});
});
}
});
}
$('#setCardsetCourseIterationFormModal').modal('hide');
$('#setCardsetCourseIterationFormModal').on('hidden.bs.modal', function () {
if (!courseIterationRoute()) {
Router.go('create');
}
});
return true;
} else if (cardsetRoute() || courseIterationRoute()) {
if (courseIterationRoute()) {
......
......@@ -20,5 +20,4 @@ Scenario: User creates a new deck of cards
And he should be able to choose a college
And he should be able to choose a course
And he should push the create new cardset button
And he should select the created cardset
And he should see the details of that cardset with the correct values
......@@ -62,11 +62,6 @@ module.exports = function () {
navigation.clickElement('#cardSetSave');
});
this.Then(/^he should select the created cardset$/, function () {
navigation.contentVisible('.modal-open', false);
navigation.selectCardsetLink(3);
});
this.Then(/^he should see the details of that cardset with the correct values$/, function () {
navigation.clickElement('#editCardset');
navigation.compareContent('#setName', title, 2, 'value');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment