Simplify envs

This commit is contained in:
Piotr Rogowski 2022-07-31 16:35:59 +02:00
parent 6ffad8e65a
commit a63a501991
No known key found for this signature in database
GPG Key ID: 4A842D702D9C6F8F
3 changed files with 4 additions and 9 deletions

4
.env
View File

@ -7,7 +7,3 @@ VITE_SENTRY_DSN=
VITE_CDN_URL=
VITE_APPWRITE_ENDPOINT=
VITE_APPWRITE_PROJECT_ID=
VITE_APPWRITE_DATABASE_ID=
VITE_APPWRITE_COLLECTION_ID_PUBLIC_TUNES=
VITE_APPWRITE_COLLECTION_ID_USERS_BUCKETS=

View File

@ -10,10 +10,10 @@ const client = new Client();
client
.setEndpoint(fetchEnv('VITE_APPWRITE_ENDPOINT'))
.setProject(fetchEnv('VITE_APPWRITE_PROJECT_ID'));
.setProject('hyper-tuner-cloud');
const account = new Account(client);
const database = new Databases(client, fetchEnv('VITE_APPWRITE_DATABASE_ID'));
const database = new Databases(client, 'public');
const storage = new Storage(client);
export {

View File

@ -11,10 +11,9 @@ import {
TuneDbDocument,
} from '../types/dbData';
import { databaseGenericError } from '../pages/auth/notifications';
import { fetchEnv } from '../utils/env';
const COLLECTION_ID_PUBLIC_TUNES = fetchEnv('VITE_APPWRITE_COLLECTION_ID_PUBLIC_TUNES');
const COLLECTION_ID_USERS_BUCKETS = fetchEnv('VITE_APPWRITE_COLLECTION_ID_USERS_BUCKETS');
const COLLECTION_ID_PUBLIC_TUNES = 'tunes';
const COLLECTION_ID_USERS_BUCKETS = 'usersBuckets';
const useDb = () => {
const updateTune = async (documentId: string, data: TuneDbDataPartial) => {