Skip to content

Commit

Permalink
Merge pull request #203 from esek/feature/hide-phos-names
Browse files Browse the repository at this point in the history
[FEATURE] Hide phøsclass
  • Loading branch information
ginger51011 authored Jul 27, 2022
2 parents 67351df + f705462 commit 428a309
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ och följer [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

### Ändrat
- Fixar att `Post.history` resolver returns history entry ID instead of `refPost` id
- Gömmer klass om förnamn innehåller phøs

## [0.19.2] - 2022-07-27

Expand Down
8 changes: 8 additions & 0 deletions src/resolvers/user.resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,14 @@ const userResolver: Resolvers = {

return providers;
},
class: ({ firstName, class: className }) => {
// hide phøsets class
if (firstName.toLowerCase().match(/ph[øö]s$/)) {
return 'XXXX';
}

return className;
},
},
Query: {
me: async (_, __, { getUsername }) => {
Expand Down

0 comments on commit 428a309

Please sign in to comment.