Skip to content

Commit 26680aa

Browse files
authored
Merge branch 'main' into refactor-4270-upgrade-react-todo-demo
2 parents e0056ff + 3121c1c commit 26680aa

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"web-vitals": "^1.0.1"
1313
},
1414
"scripts": {
15-
"start": "craco start",
15+
"start": "craco --openssl-legacy-provider start",
1616
"build": "craco build",
1717
"lint": "eslint ./src",
1818
"test": "craco test",

src/api/api.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { Client as Appwrite, Databases, Account } from 'appwrite';
2-
import { Server } from '../utils/config';
1+
import { Client as Appwrite, Databases, Account } from "appwrite";
2+
import { Server } from "../utils/config";
33

44
let api = {
55
sdk: null,
@@ -14,23 +14,24 @@ let api = {
1414
const database = new Databases(appwrite);
1515

1616
api.sdk = { database, account };
17-
return appwrite;
17+
return api.sdk;
1818
},
1919

2020
createAccount: (email, password, name) => {
21-
return api.provider().account.create('unique()', email, password, name);
21+
return api.provider().account.create("unique()", email, password, name);
2222
},
2323

2424
getAccount: () => {
25-
return api.provider().account.get();
25+
let account = api.provider().account;
26+
return account.get();
2627
},
2728

2829
createSession: (email, password) => {
2930
return api.provider().account.createEmailSession(email, password);
3031
},
3132

3233
deleteCurrentSession: () => {
33-
return api.provider().account.deleteSession('current');
34+
return api.provider().account.deleteSession("current");
3435
},
3536

3637
createDocument: (databaseId, collectionId, data, permissions) => {

0 commit comments

Comments
 (0)