Skip to content

Commit

Permalink
♻️ refactor: download proces (api-client)
Browse files Browse the repository at this point in the history
  • Loading branch information
david-vaclavek committed Apr 18, 2024
1 parent 8902c05 commit f27ff66
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
7 changes: 3 additions & 4 deletions server/services/localazy-transfer-download-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,17 +205,16 @@ module.exports = ({ strapi }) => ({
const LocalazyApi = await localazyApiClientFactory();
for (const isoLocalazy of supportedLanguages) {
const isoStrapi = isoLocalazyToStrapi(isoLocalazy);
const result = await LocalazyApi.files.listKeys({
const langKeys = await LocalazyApi.files.listKeys({
project: user.project.id,
file: strapiFile.id,
lang: isoStrapi,
});
if (!result.success) {
if (!langKeys) {
await JobNotificationService.emit(DOWNLOAD_EVENT, {
message: result.message,
message: `No keys found for language ${isoLocalazy}`,
});
}
const langKeys = result.data;
localazyContent[isoLocalazy] = langKeys;
}

Expand Down
2 changes: 0 additions & 2 deletions server/services/localazy-upload-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
"use strict";

const localazyApiClientFactory = require("../utils/localazy-api-client-factory");
const delay = require("../utils/delay");
const config = require("../config").default;

module.exports = ({ strapi }) => ({
/**
Expand Down

0 comments on commit f27ff66

Please sign in to comment.