···
r, err := repo.OpenRepo(context.TODO(), dbs, rootcid)
entries := []models.Record{}
109
+
var results []ApplyWriteResult
for i, op := range writes {
if op.Type != OpTypeCreate && op.Rkey == nil {
···
140
+
results = append(results, ApplyWriteResult{
141
+
Type: OpTypeCreate.String(),
142
+
Uri: "at://" + urepo.Did + "/" + op.Collection + "/" + *op.Rkey,
144
+
ValidationStatus: to.StringPtr("valid"), // TODO: obviously this might not be true atm lol
err := r.DeleteRecord(context.TODO(), op.Collection+"/"+*op.Rkey)
···
166
+
results = append(results, ApplyWriteResult{
167
+
Type: OpTypeUpdate.String(),
168
+
Uri: "at://" + urepo.Did + "/" + op.Collection + "/" + *op.Rkey,
170
+
ValidationStatus: to.StringPtr("valid"), // TODO: obviously this might not be true atm lol
···
224
-
var results []ApplyWriteResult
var blobs []lexutil.LexLink
for _, entry := range entries {
if err := rm.s.db.Clauses(clause.OnConflict{
···
blobs = append(blobs, lexutil.LexLink(c))
245
-
results = append(results, ApplyWriteResult{
246
-
Uri: "at://" + urepo.Did + "/" + entry.Nsid + "/" + entry.Rkey,
248
-
Commit: &RepoCommit{
249
-
Cid: newroot.String(),
252
-
ValidationStatus: to.StringPtr("valid"), // TODO: obviously this might not be true atm lol
rm.s.evtman.AddEvent(context.TODO(), &events.XRPCStreamEvent{
···
if err := dbs.UpdateRepo(context.TODO(), newroot, rev); err != nil {
275
+
for i := range results {
276
+
results[i].Commit = &RepoCommit{
277
+
Cid: newroot.String(),