Skip to content

Commit

Permalink
Revert "convert /wiki/mine domains to unicode"
Browse files Browse the repository at this point in the history
This reverts commit 3a13b91.
  • Loading branch information
deer-wmde committed Oct 12, 2023
1 parent 56b3e81 commit 8967d0e
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions src/backend/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,7 @@ export const checkVerified = async () => (await axios.post('/user/self')).data.d

/* Wiki endpoints */
export const countWikis = async () => (await axios.get('/wiki/count')).data.data // TODO This doesn't seem to exist and not used?

export const myWikis = async payload => {
const data = (await axios.post('/wiki/mine', payload)).data

// The Platform API may return domain names in ASCII encoded IDN format according to ADR no. 11
// This bit decodes them gracefully
for (let index = 0; index < data.wikis.length; index++) {
data.wikis[index].domain = punycode.toUnicode(data.wikis[index].domain)
};

return data
}

export const myWikis = async () => (await axios.post('/wiki/mine')).data
export const createWiki = async payload => {
return (await axios.post('/wiki/create', payload).catch(({ response: { data: { message, errors = {} } } }) => {
errors.message = message
Expand Down

0 comments on commit 8967d0e

Please sign in to comment.