[MM-45564] - Notify Admin v2 (#20777)
* [MM-45564] - Notify Admin v2 * add dummy data * update dummy data * add store methods * experiment with recurring task * complete saving of the notification * make improvements * make improvements * add store layer tests * fix lint * update store layer tests * add app layer unit tests * add store layers * add app layer tests * fix lint * fix lint * fix tests * fix tests lint * fix lint * fix lint * fix retry layer test * add notifications manual trigger * filter notifications based on current plan * add test case * temp change * feedback impl * fix translations * change job scheduler * refactor job * fix store layer tests * extract i18n * fix lint * fix translations * fix translations * add license statement for new file * feedback impl-2 * fix lint * update make file * add intl ids * improve * fix lint * feedback impl * move code and rename files * fix lint * feedback impl * add config for trigger notifications api * fix tests * tmp change * undo temp changes Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
c11ad8995f
Коммит
bd42f0cd8c
@@ -8020,20 +8020,36 @@ func (c *Client4) ValidateWorkspaceBusinessEmail() (*Response, error) {
|
||||
return BuildResponse(r), nil
|
||||
}
|
||||
|
||||
func (c *Client4) NotifyAdmin(nr *NotifyAdminToUpgradeRequest) int {
|
||||
func (c *Client4) NotifyAdmin(nr *NotifyAdminToUpgradeRequest) (int, error) {
|
||||
nrJSON, err := json.Marshal(nr)
|
||||
if err != nil {
|
||||
return 0
|
||||
return 0, err
|
||||
}
|
||||
|
||||
r, err := c.DoAPIPost(c.cloudRoute()+"/notify-admin-to-upgrade", string(nrJSON))
|
||||
r, err := c.DoAPIPost("/users/notify-admin", string(nrJSON))
|
||||
if err != nil {
|
||||
return r.StatusCode
|
||||
return r.StatusCode, err
|
||||
}
|
||||
|
||||
closeBody(r)
|
||||
|
||||
return r.StatusCode
|
||||
return r.StatusCode, nil
|
||||
}
|
||||
|
||||
func (c *Client4) TriggerNotifyAdmin(nr *NotifyAdminToUpgradeRequest) (int, error) {
|
||||
nrJSON, err := json.Marshal(nr)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
|
||||
r, err := c.DoAPIPost("/users/trigger-notify-admin-posts", string(nrJSON))
|
||||
if err != nil {
|
||||
return r.StatusCode, err
|
||||
}
|
||||
|
||||
closeBody(r)
|
||||
|
||||
return r.StatusCode, nil
|
||||
}
|
||||
|
||||
func (c *Client4) ValidateBusinessEmail(email *ValidateBusinessEmailRequest) (*Response, error) {
|
||||
|
||||
Ссылка в новой задаче
Block a user