-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1067 from contentstack/fix/41082
fix(import): fixed stack inaccessible issue
- Loading branch information
Showing
6 changed files
with
26 additions
and
17 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { HttpClient } from './http-client'; | ||
|
||
export const addLocale = async (apiKey, managementToken, host) => { | ||
const httpClient = new HttpClient({ | ||
headers: { api_key: apiKey, authorization: managementToken }, | ||
}); | ||
|
||
const { data } = await httpClient.post(`https://${host}/v3/locales`, { | ||
locale: { | ||
name: 'English', | ||
code: 'en-us', | ||
}, | ||
}); | ||
|
||
if ([161, 105].includes(data.error_code)) { | ||
throw new Error(data.error_code === 105 ? 'Sorry but you don\'t have access to this stack' : data.error_message); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters