File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change 8
8
<template v-else >
9
9
<AlertUpdateToLatest
10
10
v-if =" !context.psAccountsVersion || !satisfies(context.psAccountsVersion, '>=7.0.0')"
11
- :update -link =" context.psAccountsUpdateLink "
11
+ :enable -link =" context.psAccountsEnableLink "
12
12
class =" acc-mb-4"
13
13
/>
14
14
<AlertModuleDependencies
Original file line number Diff line number Diff line change @@ -14,24 +14,24 @@ import { useLocale } from '@/composables/useLocale';
14
14
import { PuikSnackbar } from ' @prestashopcorp/puik' ;
15
15
16
16
interface AlertUpdateToLatestProps {
17
- updateLink : string | null ;
17
+ enableLink : string | null ;
18
18
}
19
19
20
20
const props = defineProps <AlertUpdateToLatestProps >();
21
21
22
22
const { t } = useLocale ();
23
23
24
24
const update = async () => {
25
- if (props .updateLink ) {
25
+ if (props .enableLink ) {
26
26
try {
27
- // TODO:
28
- const response = await fetch (' ' , { method: ' POST' });
27
+ const link = props . enableLink ?. replace ( ' enable ' , ' upgrade ' );
28
+ const response = await fetch (link , { method: ' POST' });
29
29
if (! response .ok ) {
30
30
throw new Error (` An error has occured: ${response .status } ` );
31
31
}
32
32
const data = await response .json ();
33
33
34
- if (data .update .status === false ) {
34
+ if (data .ps_accounts .status === false ) {
35
35
throw new Error (' Cannot update ps_accounts module.' );
36
36
}
37
37
window .location .reload ();
You can’t perform that action at this time.
0 commit comments