Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editing of Representatives, Farms, and Demands and Some Associated Card UI Implementations #203

Open
wants to merge 27 commits into
base: develop
Choose a base branch
from

Conversation

nickwleo
Copy link
Collaborator

Hopefully not too many changes necessary on this one - tried to spot everything before submitting the pull request.

Nick Williams added 21 commits October 16, 2015 16:57
…(note to self) need to double-check that the object is being passed correctly from form.
…eed to confirm that they're unnecessary for positioning the dialog correctly.
},
function(fail) {
showDialog($mdDialog, fail, true);
});
};

$scope.newBuyerCancel = function () {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nick This function has not definition. Why was it included in the pull request?

Demand.findByIdAndUpdate({_id:req.params.demand_id}, req.body, function (err, changes) {
console.log(err, changes);
if (err) {
handleDBError(err, res);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nick22891 i believe this line may have an error. The handleDBerror should be called by prefixing common before the function name.

@nickwleo
Copy link
Collaborator Author

@tremainebuchanan - All your concerns have been addressed or responded to - please review again.

});

$scope.units = UnitsFactory.query({});
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nick22891 this line will overwrite the units already fetched from the above function call.

* This is the factory used to update a representative based on a given
* Buyer and Representative ID
*/
services.factory('RepEditFactory', function($resource) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nick22891 Notice I don't have any "EditFactories" in my code? I try my best to have just one factory that can do it all. For instance:

services.factory('BuyerFactory', function($resource) {
    return $resource('/buyer/:id', {}, {
        show: { method: 'GET'},
        create: { method: 'POST'},
        update: { method: 'PUT', params: {id: '@id'}}
    });
});

Attempt to have just one factory that can create, update and get information from the web-services.

@matjames007
Copy link
Contributor

@nick22891 I have concerns around the reuse of code. I have html partials in this project that could be reused as part of the edit functionality. You really should be reusing them.

@matjames007
Copy link
Contributor

My revision is still incomplete and will require me to pull this branch and test it offline.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants