BuildForSDGCohort2 / Team-030-Backend

Server side
0 stars 1 forks source link

Farmers Registration and login with authentication. Login which returns JWT Token. Different API Routes included. #33

Closed IdamEniIdam closed 4 years ago

IdamEniIdam commented 4 years ago

Configuration, models and validation. Models/Schema includes the Farmers model, the Farmers profile model, and the farmers Post models. Route/API. The there main route are the farmers route, the farmers profile route and the farmers post route. (1)The Farmer (User) api route are listed below: (a) @route POST api/users/registerfarmer @desc Register user @access Public (b) @route GET api/users/loginfarmer @desc Login User / Returning JWT Token @access Public (c) @route GET api/users/current @desc Return current user @access Private (2) The Farmers Profile api route are listed below: (a) @route GET api/profile/ @desc Get current farmer users profile @access Private (b) @route GET api/profile/all @desc Get all profiles @access Public (c) @route GET api/profile/username/:username @desc Get profile by username @access Public (d) @route GET api/profile/user/:user_id @desc Get farmer profile by user ID @access Public (e) @route POST api/profile @desc Create or edit farmer user profile @access Private (f) @route POST api/profile/addproduct @desc Add Product to profile @access Private (g) @route DELETE api/profile/addproduct/:prd_id @desc Delete addproduct from profile @access Private (h) @route POST api/profile/experience @desc Add farmers experience to profile @access Private (i) @route POST api/profile/education @desc Add education to profile @access Private (j) @route DELETE api/profile/experience/:exp_id @desc Delete experience from profile @access Private (k) @route DELETE api/profile/education/:edu_id @desc Delete farmer education from profile @access Private (l) @route DELETE api/profile @desc Delete user Farmer and profile @access Private (3)The Farmers Post api route listed below. (a) @route GET api/posts @desc Get posts @access Public (b) @route GET api/posts/:id @desc Get post by id @access Public (c) @route POST api/posts @desc Create post @access Private (d) @route DELETE api/posts/:id @desc Delete post @access Private (e) @route POST api/posts/like/:id @desc Like post @access Private (f) @route POST api/posts/unlike/:id @desc Unlike post @access Private (g) @route POST api/posts/comment/:id @desc Add comment to post @access Private (h) @route DELETE api/posts/comment/:id/:comment_id @desc Remove comment from post @access Private

The whole routes fine. MongoDB used.

The Validation includes farmerRegister, farmerProfile, farmerPost, farmerLogin, farmerAddProduct, farmerExperience, farmerEducation.

kingsley-einstein commented 4 years ago

Too many conflicts that should be resolved. Please pull from the develop to your local develop branch and merge with your own branch locally, then push again.

jan-far commented 4 years ago

Hello please do as Kingsley suggested. Merge your repo with the newly branched repo from develop branch. That will update your local repo