@enplug/scripts 1.11.4-dev5 → 1.11.4-dev7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -137,17 +137,15 @@ async function findCrowdinAppDirectoryId(credentials, crowdinPath) {
|
|
|
137
137
|
const appName = path.split('/')[1];
|
|
138
138
|
const url = `${CROWDIN_PROJECT_URL}/directories?filter=${appName}`;
|
|
139
139
|
const AuthStr = 'Bearer '.concat(credentials.token);
|
|
140
|
-
const
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
return directories.data.data.find(d => d.data.name === appName).id;
|
|
140
|
+
const resp = await axios.get(url, { headers: { Authorization: AuthStr } });
|
|
141
|
+
const directory = resp.data.data.find(d => d.data.name === appName );
|
|
142
|
+
return directory.data.id
|
|
144
143
|
} else if(path.startsWith('dashboard')) {
|
|
145
144
|
const url = `${CROWDIN_PROJECT_URL}/directories?filter=dashboard`;
|
|
146
145
|
const AuthStr = 'Bearer '.concat(credentials.token);
|
|
147
|
-
const
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
return directories.data.data.find(d => d.data.name === 'dashboard' && d.data.title === 'Dashboard' && d.data.path === '/dashboard').id;
|
|
146
|
+
const resp = axios.get(url, { headers: { Authorization: AuthStr } });
|
|
147
|
+
const directory = resp.data.data.find(d => d.data.name === 'dashboard' && d.data.title === 'Dashboard' && d.data.path === '/dashboard');
|
|
148
|
+
return directory.data.id;
|
|
151
149
|
}
|
|
152
150
|
}
|
|
153
151
|
|