mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-19 08:37:06 +00:00
GODT-35: New pmapi client and manager using resty
This commit is contained in:
@ -18,6 +18,7 @@
|
||||
package liveapi
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
@ -44,7 +45,7 @@ func (ctl *Controller) AddUserLabel(username string, label *pmapi.Label) error {
|
||||
label.Exclusive = getLabelExclusive(label.Name)
|
||||
label.Name = getLabelNameWithoutPrefix(label.Name)
|
||||
label.Color = pmapi.LabelColors[0]
|
||||
if _, err := client.CreateLabel(label); err != nil {
|
||||
if _, err := client.CreateLabel(context.TODO(), label); err != nil {
|
||||
return errors.Wrap(err, "failed to create label")
|
||||
}
|
||||
return nil
|
||||
@ -72,7 +73,7 @@ func (ctl *Controller) getLabelID(username, labelName string) (string, error) {
|
||||
return "", fmt.Errorf("user %s does not exist", username)
|
||||
}
|
||||
|
||||
labels, err := client.ListLabels()
|
||||
labels, err := client.ListLabels(context.TODO())
|
||||
if err != nil {
|
||||
return "", errors.Wrap(err, "failed to list labels")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user