Merge pull request #1364 from albertgasset/MOBILE-2431

MOBILE-2431 feedback: Fix feedback sync
main
Juan Leyva 2018-06-21 14:38:16 +02:00 committed by GitHub
commit cb18fd9112
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 3 deletions

View File

@ -38,7 +38,7 @@ export class AddonModFeedbackOfflineProvider {
},
{
name: 'page',
type: 'TEXT'
type: 'INTEGER'
},
{
name: 'courseid',
@ -86,9 +86,11 @@ export class AddonModFeedbackOfflineProvider {
getAllFeedbackResponses(siteId?: string): Promise<any> {
return this.sitesProvider.getSite(siteId).then((site) => {
return site.getDb().getAllRecords(AddonModFeedbackOfflineProvider.FEEDBACK_TABLE).then((entries) => {
return entries.map((entry) => {
entries.forEach((entry) => {
entry.responses = this.textUtils.parseJSON(entry.responses);
});
return entries;
});
});
}
@ -104,9 +106,11 @@ export class AddonModFeedbackOfflineProvider {
return this.sitesProvider.getSite(siteId).then((site) => {
return site.getDb().getRecords(AddonModFeedbackOfflineProvider.FEEDBACK_TABLE, {feedbackid: feedbackId});
}).then((entries) => {
return entries.map((entry) => {
entries.forEach((entry) => {
entry.responses = this.textUtils.parseJSON(entry.responses);
});
return entries;
});
}