Skip to content

Commit

Permalink
fix useAppwriteSever
Browse files Browse the repository at this point in the history
  • Loading branch information
Etienne Moureton committed Aug 4, 2023
1 parent 6fe1fdf commit 4ac55ae
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"test:watch": "vitest watch"
},
"dependencies": {
"@nuxt/kit": "^3.1.2",
"@nuxt/kit": "^3.6.5",
"appwrite": "^10.2.0",
"node-appwrite": "^8.2.0"
},
Expand Down
8 changes: 3 additions & 5 deletions src/runtime/composables/useAppwriteServer.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { Client, Databases, Users, Account, Storage, Avatars, Functions, Role, Permission, Query, ID, AppwriteException, Graphql, Locale, Teams, Health, InputFile } from 'node-appwrite'

const config = useRuntimeConfig()

class AppwriteServer {
client: Client;
users: Users;
Expand All @@ -24,9 +22,9 @@ class AppwriteServer {
constructor() {
this.client = new Client();
this.client
.setEndpoint(config.public.APPWRITE_ENDPOINT) // Your API Endpoint
.setProject(config.public.APPWRITE_PROJECT_ID) // Your project ID
.setKey(config.appwrite.APPWRITE_API_KEY) // Your secret API key
.setEndpoint(process.env.APPWRITE_ENDPOINT || '') // Your API Endpoint
.setProject(process.env.APPWRITE_PROJECT_ID || '') // Your project ID
.setKey(process.env.APPWRITE_API_KEY || '') // Your secret API key
this.databases = new Databases(this.client);
this.users = new Users(this.client)
this.account = new Account(this.client);
Expand Down

0 comments on commit 4ac55ae

Please sign in to comment.