1
0
mirror of https://github.com/mattermost/focalboard.git synced 2024-11-30 08:36:54 +02:00

moved mattermost-plugin-api dependency from model to utils

This commit is contained in:
Lev Brouk 2023-01-31 09:18:22 -08:00
parent a2366caa43
commit 49f28ae66f
2 changed files with 8 additions and 3 deletions

View File

@ -7,9 +7,8 @@ import (
"net/http" "net/http"
"strings" "strings"
"github.com/mattermost/focalboard/server/utils"
mmModel "github.com/mattermost/mattermost-server/v6/model" mmModel "github.com/mattermost/mattermost-server/v6/model"
pluginapi "github.com/mattermost/mattermost-plugin-api"
) )
var ( var (
@ -276,7 +275,7 @@ func IsErrNotFound(err error) bool {
} }
// check if this is a plugin API error // check if this is a plugin API error
if errors.Is(err, pluginapi.ErrNotFound) { if utils.IsPluginAPINotFound(err) {
return true return true
} }

View File

@ -2,9 +2,11 @@ package utils
import ( import (
"encoding/json" "encoding/json"
"errors"
"reflect" "reflect"
"time" "time"
pluginapi "github.com/mattermost/mattermost-plugin-api"
mmModel "github.com/mattermost/mattermost-server/v6/model" mmModel "github.com/mattermost/mattermost-server/v6/model"
) )
@ -119,3 +121,7 @@ func DedupeStringArr(arr []string) []string {
return dedupedArr return dedupedArr
} }
func IsPluginAPINotFound(err error) bool {
return errors.Is(err, pluginapi.ErrNotFound)
}