1
0
mirror of https://github.com/mattermost/focalboard.git synced 2024-12-24 13:43:12 +02:00
focalboard/server/app/sharing.go

25 lines
532 B
Go
Raw Normal View History

2021-01-13 01:35:30 +02:00
package app
import (
"database/sql"
"errors"
2021-01-13 01:35:30 +02:00
2021-01-27 00:13:46 +02:00
"github.com/mattermost/focalboard/server/model"
2021-03-26 20:01:54 +02:00
"github.com/mattermost/focalboard/server/services/store"
2021-01-13 01:35:30 +02:00
)
2021-03-26 20:01:54 +02:00
func (a *App) GetSharing(c store.Container, rootID string) (*model.Sharing, error) {
sharing, err := a.store.GetSharing(c, rootID)
if errors.Is(err, sql.ErrNoRows) {
2021-01-13 01:35:30 +02:00
return nil, nil
}
if err != nil {
return nil, err
}
return sharing, nil
}
2021-03-26 20:01:54 +02:00
func (a *App) UpsertSharing(c store.Container, sharing model.Sharing) error {
return a.store.UpsertSharing(c, sharing)
2021-01-13 01:35:30 +02:00
}