WeAreTech / wearetech.io

This is wearetech.io
Mozilla Public License 2.0
7 stars 2 forks source link

Registration #13

Open kbariotis opened 10 years ago

kbariotis commented 10 years ago

An attempt to resolve https://github.com/WeAreTech/wearetech.io/issues/8

thanpolas commented 10 years ago

Add this whole feature under a feature switch named cityAvailable.

An application example:

app.get('/available', [
  featureMidd.has('cityAvailable'),
  availableCtrl.use,
]);
kbariotis commented 9 years ago

Guys,

i have really stuck on this and i would like some help. What i am trying to do is 1) user goes to /available and search for $city 2) if $city is available, save it and redirect to /register (pass $city through req.flash) 3) there, we must save the user first and update the $city with the user reference in it

my problem is that on Register Controller i can't save the $city document with the reference.

Thx

/cc @thanpolas @telis93 @sirodoht

telis93 commented 9 years ago

@stakisko Have you updated the city Schema?

thanpolas commented 9 years ago

From the city (available.ctrl.js) controller you pass the cityDocument flash variable (line 74).

Then on the register.ctrl.js you do not relay that very important information to the register view (signup form line 67).

Ultimately, when the user registration form is being submitted you need to pass the city record id so it's also stored with the new user.

The city record id should now be stored in the user model, instead you need to create a new model called cityApplications which will be the model that will contain the whole city-application procedure and will link the city with the user tables (this is new)

We also need to have a skype call to discuss how to better work with entities and controllers.

Hope this helps