Update for bug fix in the regEvent model
authorSteve Sutton <steve@gaslightmedia.com>
Tue, 14 Nov 2017 16:56:10 +0000 (11:56 -0500)
committerSteve Sutton <steve@gaslightmedia.com>
Tue, 14 Nov 2017 16:56:10 +0000 (11:56 -0500)
When getting the regTime id.

js/frontRegApp.js
js/models/front/regEvent.js

index 3084bf5..5bc2da4 100644 (file)
@@ -168,7 +168,7 @@ app.Models.Front.RegEvent = Backbone.Model.extend({
                 var hasRegTime = _.findWhere(foundClass, { reg_time: foundRegTime.id });
                 if ( !hasRegTime ) {
                     foundClass.regTimes.create( foundRegTime[0] );
-                    hasRegTime = foundClass.regTimes.findWhere({ id: foundRegTime[0].id });
+                    hasRegTime = foundClass.regTimes.findWhere({ id: foundRegTime.id });
                     hasRegTime.set({ parent: foundClass });
                 }
                 // Add the registrant
index a8c57cd..23cdf74 100644 (file)
@@ -35,7 +35,7 @@ app.Models.Front.RegEvent = Backbone.Model.extend({
                 var hasRegTime = _.findWhere(foundClass, { reg_time: foundRegTime.id });
                 if ( !hasRegTime ) {
                     foundClass.regTimes.create( foundRegTime[0] );
-                    hasRegTime = foundClass.regTimes.findWhere({ id: foundRegTime[0].id });
+                    hasRegTime = foundClass.regTimes.findWhere({ id: foundRegTime.id });
                     hasRegTime.set({ parent: foundClass });
                 }
                 // Add the registrant