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

Taha's issue #59

Open
Taha-Hassan-Git opened this issue Jun 1, 2023 · 0 comments
Open

Taha's issue #59

Taha-Hassan-Git opened this issue Jun 1, 2023 · 0 comments

Comments

@Taha-Hassan-Git
Copy link

Taha-Hassan-Git commented Jun 1, 2023

Really love the concept, and loads of the functionality is there, I'm sure you're already aware of things that are not working so I won't bother commenting on them.

Something that came up for us in our project that I think you'll find interesting is also present in this code snippet in the model folder:

function createEntry(content, user_id) {
  return create_entry.get({ content, user_id });
};

And here in the routes folder entries.js:

createEntry(entry, user_id); 

By the way, they should maybe have different names. Anyway, I found a few bugs that we had from these values accidentally being put the wrong way round, and since they're being rewritten across different files I eventually found a cleaner way of working.

in the routes folder I think you should put:

entryObj = {entry, user_id}
createEntry(entryObj); 

Then in model:

function createEntry(entry) {
  return create_entry.get(entry);
};

It's not a big deal obviously, but just cleaner and less error-prone, imo.

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

No branches or pull requests

1 participant