mirror of
https://github.com/jlengrand/adyen-web.git
synced 2026-03-10 08:01:22 +00:00
* feat: draft * feat: cleaned up * feat: converted some files to ts * fix: redirect result + typescript * feat: cleaned up server * feat: adding some stories * feat: more changes * feat: small adjustments * feat: removed docs. cleaned preview * feat: cleanup * feat: clean up types * feat: adding to window object * feat: global loaders * feat: added type to loaded checkout * feat: storybook 7 + vite * feat: cleanup deps not used by vite or storybook * feat: removing unused import * Update main.ts * feat: webpack5 * feat: attempt to update packages * refactor: move storybook to lib * refactor: use rollup.dev.config.js * refactor: redirect story fix and add a11y check * refactor: rename story * refactor: split rollup config * refactor(storybook-config): use dev rollup config * remove playground-storybook folder * some fix * run storybook https * rebase main resolve conflicts * add mirrored rollup dev plugins to vite * correct postcss.config.js path * fix returnUrl * refactor: remove unused code and add types * feat: cleaning up --------- Co-authored-by: Yu Long <longyu901009@gmail.com>
14 lines
430 B
TypeScript
14 lines
430 B
TypeScript
const { host, protocol } = window.location;
|
|
|
|
export async function httpPost<T>(endpoint: string, data: any): Promise<T> {
|
|
const response = await fetch(`${protocol}//${host}/${endpoint}`, {
|
|
method: 'POST',
|
|
headers: {
|
|
Accept: 'application/json, text/plain, */*',
|
|
'Content-Type': 'application/json'
|
|
},
|
|
body: JSON.stringify(data)
|
|
});
|
|
return await response.json();
|
|
}
|