@enplug/scripts 1.11.4-dev6 → 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.
|
@@ -138,21 +138,14 @@ async function findCrowdinAppDirectoryId(credentials, crowdinPath) {
|
|
|
138
138
|
const url = `${CROWDIN_PROJECT_URL}/directories?filter=${appName}`;
|
|
139
139
|
const AuthStr = 'Bearer '.concat(credentials.token);
|
|
140
140
|
const resp = await axios.get(url, { headers: { Authorization: AuthStr } });
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
const directories = resp.data.data;
|
|
144
|
-
const appdata = directories.find(d => {
|
|
145
|
-
return d.data.name === appName
|
|
146
|
-
});
|
|
147
|
-
console.log('appdata', appdata);
|
|
148
|
-
return appdata.id
|
|
141
|
+
const directory = resp.data.data.find(d => d.data.name === appName );
|
|
142
|
+
return directory.data.id
|
|
149
143
|
} else if(path.startsWith('dashboard')) {
|
|
150
144
|
const url = `${CROWDIN_PROJECT_URL}/directories?filter=dashboard`;
|
|
151
145
|
const AuthStr = 'Bearer '.concat(credentials.token);
|
|
152
|
-
const
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
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;
|
|
156
149
|
}
|
|
157
150
|
}
|
|
158
151
|
|