Skip to content
This repository has been archived by the owner on Mar 22, 2019. It is now read-only.

[WIP] add addSocialMediaAccount mutation #233

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Kachulio1
Copy link
Member

@Kachulio1 Kachulio1 commented Mar 13, 2019

fixes #/Human-Connection/Nitro-Web/issues/125

@@ -7,7 +7,7 @@ export default async (driver, authorizationHeader) => {
try {
const decoded = await jwt.verify(token, process.env.JWT_SECRET)
id = decoded.sub
} catch {
} catch (e) {
Copy link
Member

Choose a reason for hiding this comment

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

e could also mean event, as a good practice use err or error instead.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, I will change that, and how was that merged to master with a syntax error merged.

Copy link
Member

Choose a reason for hiding this comment

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

That’s a really good question.

@@ -56,7 +56,8 @@ const permissions = shield({
CreateBadge: isAdmin,
UpdateBadge: isAdmin,
DeleteBadge: isAdmin,

addSocialMediaAccount: isAuthenticated,
Copy link
Member

Choose a reason for hiding this comment

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

Is it really social media when you can enter everything? Should we maybe limit that can be entered to prevent abuse? What do you think?

const [currentUser] = await result.records.map(function (record) {
return record.get('user')
const [currentUser] = await result.records.map(function(record) {
return record.get("user")
Copy link
Member

Choose a reason for hiding this comment

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

Please use single quotes where possible.

Copy link
Member Author

Choose a reason for hiding this comment

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

sorry, will configure my prettier to use single quotes.

@@ -25,27 +25,54 @@ export default {

return true
},
login: async (parent, { email, password }, { driver, req, user }) => {
login: async (_, { email, password }, { driver, req, user }) => {
Copy link
Member

Choose a reason for hiding this comment

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

What renaming the parent?

Copy link
Member Author

Choose a reason for hiding this comment

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

we are not using it, so I thought I could use a convention that I have seen, where the _ indicates that I'm not going to use that parameter

Copy link
Member Author

Choose a reason for hiding this comment

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

it also helps with the linter

@@ -12,6 +12,7 @@ type Mutation {
report(id: ID!, description: String): Report
disable(id: ID!): ID
enable(id: ID!): ID
addSocialMediaAccount(url: String!): Boolean!
Copy link
Member

Choose a reason for hiding this comment

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

It’s not a account using it?

Copy link
Member Author

Choose a reason for hiding this comment

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

what do you mean? change the name to addSocialMedia

Copy link
Member

Choose a reason for hiding this comment

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

Yeah for example. I find account on the user node a bit missleading as it might suggest third party logins.

Copy link
Member

Choose a reason for hiding this comment

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

Also should we maybe suggest in the name where we are adding it? For example: addUserSocialMedia?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah

@mattwr18 mattwr18 changed the title add addSocialMediaAccount mutation [WIP] add addSocialMediaAccount mutation Mar 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants