From 4ac55aebbf5a5b266f6a4b17bf6fbb34c464c87d Mon Sep 17 00:00:00 2001 From: Etienne Moureton Date: Fri, 4 Aug 2023 21:12:58 +0200 Subject: [PATCH] fix useAppwriteSever --- package-lock.json | 2 +- package.json | 2 +- src/runtime/composables/useAppwriteServer.ts | 8 +++----- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/package-lock.json b/package-lock.json index 67d6588..0eed028 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "1.6.4", "license": "MIT", "dependencies": { - "@nuxt/kit": "^3.1.2", + "@nuxt/kit": "^3.6.5", "appwrite": "^10.2.0", "node-appwrite": "^8.2.0" }, diff --git a/package.json b/package.json index 1e391e0..78c8a5b 100644 --- a/package.json +++ b/package.json @@ -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" }, diff --git a/src/runtime/composables/useAppwriteServer.ts b/src/runtime/composables/useAppwriteServer.ts index 1c2b68b..0d7a0de 100644 --- a/src/runtime/composables/useAppwriteServer.ts +++ b/src/runtime/composables/useAppwriteServer.ts @@ -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; @@ -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);