Skip to content
Snippets Groups Projects
Commit d99d3489 authored by git-directory-deploy's avatar git-directory-deploy
Browse files

publish: consent for load curve data and manual execution

generated from commit 1ca126af
parent 61106ac2
No related branches found
No related tags found
No related merge requests found
......@@ -317,6 +317,28 @@ async function checkConsentForLoadCurve(
}
}
 
/**
* Function checking if the history is loaded
*/
async function isHistoryLoaded(doctype) {
log('debug', doctype, 'Retrieve data')
const result = await cozyClient.data.findAll(doctype)
if (result && result.length > 0) {
const filtered = result.filter(function(el) {
const elDate = moment({ year : el.year, month : el.month, day : el.day})
return (
elDate.isBefore(startLoadDate)
)
})
if (filtered.length > 0) {
return false
} else {
return true
}
}
return false
}
/**
* Launch process to handle load data
*/
......@@ -548,29 +570,6 @@ async function buildDataFromKey(doctype, key, value) {
}
}
 
/**
* Function checking if the history is loaded
*/
async function isHistoryLoaded(doctype) {
log('debug', doctype, 'Retrieve data')
const result = await cozyClient.data.findAll(doctype)
if (result && result.length > 0) {
const filtered = result.filter(function(el) {
return (
el.year <= startLoadDate.year &&
el.month <= startLoadDate.month &&
el.day <= startLoadDate.day-1
)
})
if (filtered.length > 0) {
return false
} else {
return true
}
}
return false
}
/**
* Function handling special case.
* The temporary aggregated data need to be remove in order for the most recent one te be saved.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment