Load KF works
This commit is contained in:
@@ -5,6 +5,25 @@ class KeyframesModel extends WindozModel {
|
||||
this.ressource = '/keyframes'
|
||||
}
|
||||
|
||||
async list(kfId, prevKFId='') {
|
||||
let endpoint = {...app.config.api[this.ressource].list}
|
||||
const filters = {}
|
||||
//Caution, undefined is != NULL here, because prev_kfId ull means root, while undefined means no filtering
|
||||
if((typeof(kfId) != 'undefined') && (kfId!=='')) filters['kfId'] = kfId
|
||||
if((typeof(prevKFId) != 'undefined') && (prevKFId!=='')) filters['prevKFId'] = prevKFId
|
||||
return (
|
||||
this.request(endpoint.uri, endpoint.method, filters)
|
||||
)
|
||||
}
|
||||
|
||||
async getKeyframe(kfId){
|
||||
let endpoint = {...app.config.api[this.ressource].get}
|
||||
endpoint.uri = endpoint.uri.replace('{kfId}', kfId)
|
||||
return (
|
||||
this.request(endpoint.uri, endpoint.method, kfId)
|
||||
)
|
||||
}
|
||||
|
||||
async create(kfData, prevKFId) {
|
||||
let endpoint = {...app.config.api[this.ressource].create}
|
||||
return (
|
||||
@@ -24,6 +43,7 @@ class KeyframesModel extends WindozModel {
|
||||
const { position, speed, ...storeValues} = data[aid].values
|
||||
return({
|
||||
aid: aid,
|
||||
type: data[aid].type,
|
||||
storeValues: storeValues,
|
||||
gpsValues: { position: data[aid].values.position, speed: data[aid].values.speed }
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user