Skip to content

Add books to favourites catalog#7

Open
kgogola wants to merge 4 commits into
LaYatiX:masterfrom
kgogola:KamilTask2
Open

Add books to favourites catalog#7
kgogola wants to merge 4 commits into
LaYatiX:masterfrom
kgogola:KamilTask2

Conversation

@kgogola

@kgogola kgogola commented Apr 15, 2018

Copy link
Copy Markdown
Collaborator

In Book component I included button which allow to add some books to favourites catalog. User can add book just once, so it can't be a couple of same books in this catalog.
I also included simple layout to watching results, but it should be replaced with layout from my previous task.

Comment thread components/Book.vue
},
props: ['title', 'author', 'description', 'img', 'id', 'nrFav'],
methods: {
addFavourite () {

@gckprs gckprs Apr 16, 2018

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This way you just unnecessarily duplicate data. I think the logic would be much easier / more effective if every book simply had predicate isFavourite property. Then adding / removing would only take one operation. In addition to that you could easily _.filter() books to get favourite ones.
Someone correct me if I'm wrong, please.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Agree with you

@k911

k911 commented Apr 16, 2018

Copy link
Copy Markdown

@kgogola
Commit message:
Adding books to favourites catalog -> Add books to favourites catalog

$ git commit --amend "Add books to favourites catalog"
$ git push origin PUT_YOU_BRANCH_NAME_HERE --force

Commit messages should always be written in imperative mode

@kgogola kgogola changed the title Adding books to favourites catalog Add books to favourites catalog Apr 16, 2018
@k911

k911 commented Apr 17, 2018

Copy link
Copy Markdown

@kgogola You have to run script I've provided you in your console in your project directory

@kgogola

kgogola commented Apr 18, 2018

Copy link
Copy Markdown
Collaborator Author

@k911 I' ve got some troubles with editing commit. I get such error:
"error: pathspec 'Add books to favourites catalog' did not match any file(s) known to git."
I was trying edit it by other devices as well but also without succes, end that's why I created new commit.
Could you explain me what might be incorectly with it? I was using Git Bash

@k911

k911 commented Apr 19, 2018

Copy link
Copy Markdown

I think that you've really messed up here 😄

You you can do interactive rebase:

$ git rebase -i HEAD~3

and accordingly 'reword' fist commit, to proper name which is 'Add books to favourites catalog'
and fixup commits bellow like here: (Another project, but you should see almost the same view)

screen shot 2018-04-19 at 17 22 19

@LaYatiX LaYatiX left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Can't accept it for now. If you have any question please contact me on slack

Now data aren't copied. Button change ''isFav'' property and it's allows to display favourites books in appropriate catalog.
@kgogola

kgogola commented Apr 24, 2018

Copy link
Copy Markdown
Collaborator Author

Sorry guyz for time lag, I had some issues :/ I hope the new update will be correct. Unfortunately still I can't change this name of commit, I don't really now @k911 what did I break there, now I get such notice:
"Cannot rebase: Your index contains uncommitted changes.
Please commit or stash them."

In git status I have certain new file. I think here is the problem. Reset command not working and cached as well.

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

Successfully merging this pull request may close these issues.

5 participants