Merge pull request #5027 from penpot/niwinz-backend-improvements

 Add efficiency improvements to xlog task
This commit is contained in:
Alejandro 2024-08-27 09:59:59 +02:00 committed by GitHub
commit 67cd855e97
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 229 additions and 92 deletions

View file

@ -499,17 +499,16 @@
(js/console.log "EE:" cause))))))
(defn ^:export restore-snapshot
[id file-id]
[label file-id]
(when-let [file-id (or (d/parse-uuid file-id)
(:current-file-id @st/state))]
(when-let [id (d/parse-uuid id)]
(->> (http/send! {:method :post
:uri (u/join cf/public-uri "api/rpc/command/restore-file-snapshot")
:body (http/transit-data {:file-id file-id :id id})})
(rx/map http/conditional-decode-transit)
(rx/mapcat rp/handle-response)
(rx/subs! (fn [_]
(println "Snapshot restored " id)
#_(.reload js/location))
(fn [cause]
(js/console.log "EE:" cause)))))))
(->> (http/send! {:method :post
:uri (u/join cf/public-uri "api/rpc/command/restore-file-snapshot")
:body (http/transit-data {:file-id file-id :label label})})
(rx/map http/conditional-decode-transit)
(rx/mapcat rp/handle-response)
(rx/subs! (fn [_]
(println "Snapshot restored " label)
#_(.reload js/location))
(fn [cause]
(js/console.log "EE:" cause))))))