-
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.
* Add webhook form markup * Update webhook api call * Add try webhook action * Fix test webhook
- Loading branch information
Showing
6 changed files
with
328 additions
and
17 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { MutateShape, Resource, SchemaDetail } from "rest-hooks"; | ||
import BaseResource from "./BaseResource"; | ||
|
||
export interface Notifications { | ||
status: string; | ||
message: string; | ||
} | ||
|
||
export default class NotificationsResource | ||
extends BaseResource | ||
implements Notifications { | ||
readonly status: string = ""; | ||
readonly message: string = ""; | ||
|
||
pk(): string { | ||
return ""; | ||
} | ||
|
||
static urlRoot = "notifications"; | ||
|
||
static tryShape<T extends typeof Resource>( | ||
this: T | ||
): MutateShape<SchemaDetail<Notifications>> { | ||
return { | ||
...super.partialUpdateShape(), | ||
getFetchKey: (params) => | ||
"POST /notifications/try" + JSON.stringify(params), | ||
fetch: async ( | ||
params: Readonly<Record<string, unknown>> | ||
): Promise<Notifications> => | ||
await this.fetch("post", `${this.url(params)}/try`, params), | ||
schema: this, | ||
}; | ||
} | ||
} |
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.