mirror of
https://gh.wpcy.net/https://github.com/elementor/one-click-accessibility.git
synced 2026-04-25 04:08:46 +08:00
* [APP-934] add submit logic * [APP-934] add submit logic * [APP-934] add submit logic * [APP-934] add submit logic * Added replace remediation action * Add submit logic * Add submit alt text logic, generate AI alt text * Add AI generate request, add convert from SVG to png base64, added manual fix block * Add AI generate request, add convert from SVG to png base64, added manual fix block * Add texts, add remediation submit, fix logic to store remediation * Add texts, add remediation submit, fix logic to store remediation * Add texts, add remediation submit, fix logic to store remediation * Add texts, add remediation submit, fix logic to store remediation * Add texts, add remediation submit, fix logic to store remediation * Add texts, add remediation submit, fix logic to store remediation --------- Co-authored-by: Raz Ohad <admin@bainternet.info>
30 lines
583 B
JavaScript
30 lines
583 B
JavaScript
import APISettings from '../api';
|
|
import { GOLINKS } from '../constants';
|
|
|
|
export const useAuth = () => {
|
|
const { subscriptionId } = 123;
|
|
|
|
const redirectToConnect = async () => {
|
|
const link = await getConnectLink();
|
|
|
|
window.open(link, '_self').focus();
|
|
};
|
|
|
|
const getConnectLink = async () => {
|
|
return APISettings.initConnect();
|
|
};
|
|
|
|
const getUpgradeLink = () => {
|
|
const url = new URL(GOLINKS.UPGRADE);
|
|
|
|
url.searchParams.append('subscription_id', subscriptionId);
|
|
|
|
return url.toString();
|
|
};
|
|
|
|
return {
|
|
redirectToConnect,
|
|
getConnectLink,
|
|
getUpgradeLink,
|
|
};
|
|
};
|