23 Commits

Author SHA1 Message Date
Matt Rider
512bf32b0c Update cypress tests, fix broken comment reactivity 2019-08-20 21:27:00 +02:00
Matt Rider
8735045d11 Update cypress tests, post query 2019-08-20 20:13:29 +02:00
kachulio1
314dfcf413 Throw error if no categories on post creation
Co-authored-by: mattwr18 <mattwr18@gmail.com>
2019-08-15 17:55:02 +03:00
roschaefer
5103bdbc2a Fix tests 2019-08-13 11:50:33 +02:00
Robert Schäfer
8de0195cf8 Keep existing filter params + same for text search 2019-08-13 11:05:29 +02:00
Robert Schäfer
5fb60d1132 Implement+test blocking a user on backend 2019-08-13 11:05:29 +02:00
Robert Schäfer
963cbbef32 RemovePostEmotions should return deleted object
@mattwr18 I prefer (I believe it's even best practice) that a delete
mutation should return the deleted object. If you run the delete
mutation again, it should return `null` because there is no object like
that anymore. That way the client knows if a delete mutation has changed
any state in the database.

Also I fixed another bug in the resolver. If your graphql mutation looks
like this:

```gql
mutation {
  RemovePostEmotions(to:{ id:"p15"}, data:{emotion: angry}) {
    from {
      id
      name
    }
    to {
      id
      title
    }
    emotion
  }
}
```

Then you get errors because your resolver does not return the name for
the user or the title for the post anymore. Just use spread operator...
and it's fixed.
2019-08-08 23:51:26 +02:00
Robert Schäfer
f3e545a913 Fix bug: Only add emotions for authenticated user 2019-08-08 23:10:01 +02:00
Matt Rider
39a94a8aac Refactor
- follow PR review by @roschaefer
2019-08-07 14:55:32 +02:00
Matt Rider
cb7217f5a7 Fix bug
- apollo query fetchPolicy set to no-cache so that it will refetch a post's emotions count on page transition
2019-08-06 08:05:35 +02:00
Matt Rider
97ff2e9457 Make emotionsArray a const, fix lint 2019-08-05 09:50:25 +02:00
Matt Rider
fb9a632d55 Query a currentUsers emotions for a post, translations 2019-08-01 15:11:41 +02:00
Matt Rider
5423412958 Set up UI 2019-07-31 14:58:05 +02:00
Matt Rider
0a98113c2d Add backend tests for RemovePostEmotions 2019-07-30 13:28:30 +02:00
Matt Rider
3e43539e23 Set up some backend tests for emotions 2019-07-29 17:08:07 +02:00
Matt Rider
16f077fe65 Add authentication tests for AddPostEmotions, emotionsCount 2019-07-16 11:02:43 -03:00
Matt Rider
b034d22732 Fix failing cypress test 2019-07-01 18:50:24 -03:00
Matt Rider
f302961376 Get categories working with UpdatePost, refactor 2019-07-01 18:00:55 -03:00
Matt Rider
865e2c0ec3 Refactor resolver, rename params
- Use one cypher statement

Co-authored-by: Tirokk <wolle.huss@pjannto.com>
2019-06-28 10:17:22 -03:00
Matt Rider
351f258fab Refactor resolver, write component tests
- use UNWIND instead of iterating over categories(cypher magic)
- do not return nested categories on post creation as it's expensive and we don't use
- refactor backend test
- component tests for CategoriesSelect
2019-06-27 16:57:55 -03:00
Matt Rider
07576d084c Get categories working with CreatePost 2019-06-26 15:59:57 -03:00
Matt Rider
d714927315 Set up backend for Post creation with categories 2019-06-26 11:26:44 -03:00
f78c54a3e8
refactored backend structure 2019-05-31 19:31:39 +02:00