Skip to content

Commit

Permalink
Merge pull request #4122 from oat-sa/feature/ADF-1789/sync-items-tran…
Browse files Browse the repository at this point in the history
…slations

Feature/ADF-1789/Sync items translations
  • Loading branch information
jsconan authored Nov 4, 2024
2 parents df4a780 + 8fd52e3 commit ad1d640
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
14 changes: 14 additions & 0 deletions views/js/services/translation.js
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,20 @@ define(['i18n', 'core/request', 'util/url'], function (__, request, urlUtil) {
method: 'POST',
noToken: true
}).then(response => response.data);
},

/**
* Synchronizes the translations.
* @param {string} id - The URI of the resource.
* @returns {Promise<Resource>}
*/
syncTranslation(id) {
return request({
url: urlUtil.route('sync', 'Translation', 'tao'),
data: { id },
method: 'POST',
noToken: true
}).then(response => response.data);
}
};
});
3 changes: 2 additions & 1 deletion views/js/test/services/translation/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ define(['services/translation'], function (translationService) {
{ title: 'getTranslations', type: 'function' },
{ title: 'createTranslation', type: 'function' },
{ title: 'updateTranslation', type: 'function' },
{ title: 'deleteTranslation', type: 'function' }
{ title: 'deleteTranslation', type: 'function' },
{ title: 'syncTranslation', type: 'function' }
])
.test('translationService API', function (data, assert) {
assert.equal(
Expand Down

0 comments on commit ad1d640

Please sign in to comment.