Monorepo for Tangled tangled.org

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
··· 3 3 import ( 4 4 "fmt" 5 5 "strings" 6 - "time" 7 6 8 - "github.com/bluesky-social/indigo/atproto/syntax" 7 + "tangled.org/core/appview/models" 9 8 ) 10 9 11 - type Collaborator struct { 12 - // identifiers for the record 13 - Id int64 14 - Did syntax.DID 15 - Rkey string 16 - 17 - // content 18 - SubjectDid syntax.DID 19 - RepoAt syntax.ATURI 20 - 21 - // meta 22 - Created time.Time 23 - } 24 - 25 - func AddCollaborator(e Execer, c Collaborator) error { 10 + func AddCollaborator(e Execer, c models.Collaborator) error { 26 11 _, err := e.Exec( 27 12 `insert into collaborators (did, rkey, subject_did, repo_at) values (?, ?, ?, ?);`, 28 13 c.Did, c.Rkey, c.SubjectDid, c.RepoAt,
+21
appview/models/collaborator.go
··· 1 + package models 2 + 3 + import ( 4 + "time" 5 + 6 + "github.com/bluesky-social/indigo/atproto/syntax" 7 + ) 8 + 9 + type Collaborator struct { 10 + // identifiers for the record 11 + Id int64 12 + Did syntax.DID 13 + Rkey string 14 + 15 + // content 16 + SubjectDid syntax.DID 17 + RepoAt syntax.ATURI 18 + 19 + // meta 20 + Created time.Time 21 + }
+1 -1
appview/repo/repo.go
··· 1567 1567 return 1568 1568 } 1569 1569 1570 - err = db.AddCollaborator(tx, db.Collaborator{ 1570 + err = db.AddCollaborator(tx, models.Collaborator{ 1571 1571 Did: syntax.DID(currentUser.Did), 1572 1572 Rkey: rkey, 1573 1573 SubjectDid: collaboratorIdent.DID,