forked from hoppscotch/hoppscotch
-
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.
feat: copyable invite links (hoppscotch#4153)
Co-authored-by: Andrew Bastin <andrewbastin.k@gmail.com> Co-authored-by: jamesgeorge007 <25279263+jamesgeorge007@users.noreply.github.com>
- Loading branch information
1 parent
0c06f26
commit 2917d50
Showing
7 changed files
with
119 additions
and
4 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
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,5 @@ | ||
import * as E from "fp-ts/Either" | ||
|
||
export type InfraPlatformDef = { | ||
getIsSMTPEnabled?: () => Promise<E.Either<string, boolean>> | ||
} |
3 changes: 3 additions & 0 deletions
3
packages/hoppscotch-selfhost-web/src/api/queries/GetSMTPStatus.graphql
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,3 @@ | ||
query GetSMTPStatus { | ||
isSMTPEnabled | ||
} |
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
23 changes: 23 additions & 0 deletions
23
packages/hoppscotch-selfhost-web/src/platform/infra/infra.platform.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { runGQLQuery } from "@hoppscotch/common/helpers/backend/GQLClient" | ||
import { InfraPlatformDef } from "@hoppscotch/common/platform/infra" | ||
import { GetSmtpStatusDocument } from "../../api/generated/graphql" | ||
import * as E from "fp-ts/Either" | ||
|
||
const getSMTPStatus = () => { | ||
return runGQLQuery({ | ||
query: GetSmtpStatusDocument, | ||
variables: {}, | ||
}) | ||
} | ||
|
||
export const InfraPlatform: InfraPlatformDef = { | ||
getIsSMTPEnabled: async () => { | ||
const res = await getSMTPStatus() | ||
|
||
if (E.isRight(res)) { | ||
return E.right(res.right.isSMTPEnabled) | ||
} | ||
|
||
return E.left("SMTP_STATUS_FETCH_FAILED") | ||
}, | ||
} |