-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #76 from WildCodeSchool/feat/account-query-profile…
…-page Feat/account query profile page
- Loading branch information
Showing
25 changed files
with
685 additions
and
340 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
import { User, UserRoleType } from "entities"; | ||
import { AuthChecker } from "type-graphql"; | ||
// import { User, UserRoleType } from "entities"; | ||
// import { AuthChecker } from "type-graphql"; | ||
|
||
export const authChecker: AuthChecker<{ user: User | null }, UserRoleType> = ( | ||
{ context }, | ||
roles | ||
): boolean => { | ||
if (!context.user) { | ||
return false; | ||
} | ||
// export const authChecker: AuthChecker<{ user: User | null }, UserRoleType> = ( | ||
// { context }, | ||
// roles | ||
// ): boolean => { | ||
// if (!context.user) { | ||
// return false; | ||
// } | ||
|
||
if (roles.length === 0) { | ||
return true; | ||
} | ||
// if (roles.length === 0) { | ||
// return true; | ||
// } | ||
|
||
return roles.includes(context.user.role); | ||
}; | ||
// return roles.includes(context.user.role); | ||
// }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
backend/src/inputs/InputUser.ts → backend/src/inputs/InputUserCreate.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { Field, InputType } from "type-graphql"; | ||
|
||
@InputType() | ||
export class InputUserLogin { | ||
@Field() | ||
email: string; | ||
|
||
@Field() | ||
password: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
import { InputUserCreate } from "./InputUserCreate"; | ||
import { InputCreateCategory } from "./InputCreateCategory"; | ||
import { InputCreateProduct } from "./InputCreateProduct"; | ||
import { InputUpdateProduct } from "./InputUpdateProduct"; | ||
import { InputUser } from "./InputUser"; | ||
import { InputUserLogin } from "./InputUserLogin"; | ||
|
||
export { | ||
InputCreateCategory, | ||
InputCreateProduct, | ||
InputUpdateProduct, | ||
InputUser, | ||
InputUserLogin, | ||
InputUserCreate | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.