feat(tag): draft for inline editing
Some checks failed
Build and Push Docker Image / Build-And-Push-Docker-Image (push) Failing after 1m15s
Some checks failed
Build and Push Docker Image / Build-And-Push-Docker-Image (push) Failing after 1m15s
This commit is contained in:
@@ -14,6 +14,7 @@ type Service interface {
|
||||
delete(ctx context.Context, user *auth_types.User, tagId uuid.UUID) error
|
||||
get(ctx context.Context, user *auth_types.User, tagId uuid.UUID) (*Tag, error)
|
||||
getAll(ctx context.Context, user *auth_types.User) ([]Tag, error)
|
||||
find(ctx context.Context, user *auth_types.User, search string) ([]Tag, error)
|
||||
}
|
||||
|
||||
type ServiceImpl struct {
|
||||
@@ -105,6 +106,13 @@ func (s ServiceImpl) getAll(ctx context.Context, user *auth_types.User) ([]Tag,
|
||||
return s.db.getAll(ctx, user.Id)
|
||||
}
|
||||
|
||||
func (s ServiceImpl) find(ctx context.Context, user *auth_types.User, search string) ([]Tag, error) {
|
||||
if user == nil {
|
||||
return nil, core.ErrUnauthorized
|
||||
}
|
||||
|
||||
return s.db.find(ctx, user.Id, search)
|
||||
}
|
||||
func (s ServiceImpl) isTagValid(tag Tag) bool {
|
||||
err := core.ValidateString(tag.Name, "name")
|
||||
return err == nil
|
||||
|
||||
Reference in New Issue
Block a user