kf save almost good

This commit is contained in:
STEINNI
2025-10-26 20:03:19 +00:00
parent 4e1f6886f2
commit f349ff38f4
5 changed files with 58 additions and 18 deletions
+17 -4
View File
@@ -5,7 +5,21 @@ class KeyframesModel extends WindozModel {
this.ressource = '/keyframes'
}
async save(data) {
async create(kfData, prevKFId) {
let endpoint = {...app.config.api[this.ressource].create}
return (
this.request(endpoint.uri, endpoint.method, kfData)
)
}
async rename(kfData, prevKFId) {
let endpoint = {...app.config.api[this.ressource].create}
return (
this.request(endpoint.uri, endpoint.method, kfData)
)
}
async save(kfId, data) {
const kfData = Object.keys(data).map(aid => {
const { position, speed, ...storeValues} = data[aid].values
return({
@@ -15,9 +29,8 @@ class KeyframesModel extends WindozModel {
})
})
let endpoint = {...app.config.api[this.ressource].getTypes}
endpoint.uri = endpoint.uri.replace('{family}', data.kfId || '')
const aid = Object.keys(x)[data]
let endpoint = {...app.config.api[this.ressource].saveAgents}
endpoint.uri = endpoint.uri.replace('{kfId}', kfId)
return (
this.request(endpoint.uri, endpoint.method, kfData)
)