forked from tangled.org/core
this repo has no description

appview/models: move db.Collaborator into models

Signed-off-by: oppiliappan <me@oppi.li>

oppi.li ea02bd91 454dcc8e

verified
Changed files
+24 -18
appview
+2 -17
appview/db/collaborators.go
···
import (
"fmt"
"strings"
-
"time"
-
"github.com/bluesky-social/indigo/atproto/syntax"
+
"tangled.org/core/appview/models"
)
-
type Collaborator struct {
-
// identifiers for the record
-
Id int64
-
Did syntax.DID
-
Rkey string
-
-
// content
-
SubjectDid syntax.DID
-
RepoAt syntax.ATURI
-
-
// meta
-
Created time.Time
-
}
-
-
func AddCollaborator(e Execer, c Collaborator) error {
+
func AddCollaborator(e Execer, c models.Collaborator) error {
_, err := e.Exec(
`insert into collaborators (did, rkey, subject_did, repo_at) values (?, ?, ?, ?);`,
c.Did, c.Rkey, c.SubjectDid, c.RepoAt,
+21
appview/models/collaborator.go
···
+
package models
+
+
import (
+
"time"
+
+
"github.com/bluesky-social/indigo/atproto/syntax"
+
)
+
+
type Collaborator struct {
+
// identifiers for the record
+
Id int64
+
Did syntax.DID
+
Rkey string
+
+
// content
+
SubjectDid syntax.DID
+
RepoAt syntax.ATURI
+
+
// meta
+
Created time.Time
+
}
+1 -1
appview/repo/repo.go
···
return
-
err = db.AddCollaborator(tx, db.Collaborator{
+
err = db.AddCollaborator(tx, models.Collaborator{
Did: syntax.DID(currentUser.Did),
Rkey: rkey,
SubjectDid: collaboratorIdent.DID,