-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor notification resoruce to use react-query (#11476)
- Loading branch information
Showing
5 changed files
with
58 additions
and
55 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
airbyte-webapp/src/core/domain/notification/NotificationService.tsx
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,21 @@ | ||
import { AirbyteRequestService } from "core/request/AirbyteRequestService"; | ||
import { NotificationStatus } from "./types"; | ||
|
||
class NotificationService extends AirbyteRequestService { | ||
get url(): string { | ||
return "notifications"; | ||
} | ||
|
||
public try(payload: { | ||
notificationType: "slack"; | ||
sendOnSuccess: boolean; | ||
sendOnFailure: boolean; | ||
slackConfiguration: { | ||
webhook: string; | ||
}; | ||
}): Promise<NotificationStatus> { | ||
return this.fetch<NotificationStatus>(`${this.url}/try`, payload); | ||
} | ||
} | ||
|
||
export { NotificationService }; |
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 @@ | ||
export interface NotificationStatus { | ||
status: string; | ||
message: string; | ||
} |
This file was deleted.
Oops, something went wrong.
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