-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f728f89
commit 7ae2d38
Showing
9 changed files
with
197 additions
and
67 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
1 change: 1 addition & 0 deletions
1
hasura/migrations/1691747987091_add_dework_to_account_type/down.sql
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 @@ | ||
DELETE FROM "AccountType" WHERE type = 'DEWORK'; |
4 changes: 4 additions & 0 deletions
4
hasura/migrations/1691747987091_add_dework_to_account_type/up.sql
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,4 @@ | ||
INSERT INTO "AccountType" | ||
(type) VALUES ('DEWORK') | ||
ON CONFLICT DO NOTHING -- allow multiple runs | ||
; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { client } from './client'; | ||
|
||
const playerDeworkUsernameQuery = /* GraphQL */ ` | ||
query GetPlayerDeworkUsername($playerId: uuid!) { | ||
player_account(where: { playerId: {_eq: $playerId}, type: {_eq: DEWORK}}) { | ||
identifier | ||
} | ||
} | ||
` | ||
|
||
export const getPlayerDeworkUsername = async (playerId: string): Promise<string> => { | ||
if (!playerId) return '' | ||
let info = await client.query<any>(playerDeworkUsernameQuery, { playerId }) | ||
const username = info?.data?.player_account[0]?.identifier | ||
return username | ||
} |
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,13 @@ | ||
export const UpsertDeworkUsername = /* GraphQL */ ` | ||
mutation UpsertDeworkProfile( | ||
$playerId: uuid!, | ||
$identifier: String!, | ||
$type: String! | ||
) { | ||
insert_player_account_one(object: {identifier: $identifier, playerId: $playerId, type: DEWORK}, on_conflict: {constraint: Account_identifier_type_key, update_columns: identifier}) { | ||
identifier | ||
playerId | ||
type | ||
} | ||
} | ||
` |
Oops, something went wrong.