-
Notifications
You must be signed in to change notification settings - Fork 11.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FIX] App's i18nAlert is only being displayed as "i18nAlert" (#11802)
* Fix the i18nAlert not being displayed from Apps * Fix the apps http being invalid when being used as promises
- Loading branch information
1 parent
22974cf
commit 350738b
Showing
2 changed files
with
17 additions
and
15 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,13 +1,15 @@ | ||
export class AppHttpBridge { | ||
call(info) { | ||
async call(info) { | ||
if (!info.request.content && typeof info.request.data === 'object') { | ||
info.request.content = JSON.stringify(info.request.data); | ||
} | ||
|
||
console.log(`The App ${ info.appId } is requesting from the outter webs:`, info); | ||
|
||
return new Promise((resolve, reject) => { | ||
HTTP.call(info.method, info.url, info.request, (e, result) => (e ? reject(e.response) : resolve(result))); | ||
}); | ||
try { | ||
return HTTP.call(info.method, info.url, info.request); | ||
} catch (e) { | ||
return e.response; | ||
} | ||
} | ||
} |