From 8c1878d4aa8666817ec5551b8fbf36775a90a11a Mon Sep 17 00:00:00 2001 From: Simon Date: Thu, 4 Aug 2022 11:48:29 +0200 Subject: [PATCH] feat(webapp): protect data view with pin --- package.json | 2 +- src/App.vue | 1 - src/components/services/data.service.ts | 37 ++++++++-------- src/components/views/DataView.vue | 56 ++++++++++++++++++------- 4 files changed, 61 insertions(+), 35 deletions(-) diff --git a/package.json b/package.json index 680c1e4..4bba08e 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "private": true, "version": "0.0.0", "scripts": { - "dev": "vite", + "dev": "vite --host", "build": "vue-tsc --noEmit && vite build", "lint": "eslint -c .eslintrc.js src/", "preview": "vite preview" diff --git a/src/App.vue b/src/App.vue index f499f17..ca3058e 100644 --- a/src/App.vue +++ b/src/App.vue @@ -25,7 +25,6 @@ const navigationEntries: INavigationEntry[] = [ name: 'Stammdaten', icon: UserIcon, to: '/data', - disabled: true, }, { name: 'Einstempeln', diff --git a/src/components/services/data.service.ts b/src/components/services/data.service.ts index f13f40e..8a1e52c 100644 --- a/src/components/services/data.service.ts +++ b/src/components/services/data.service.ts @@ -16,23 +16,26 @@ const database = new Databases(sdk, DATABASE_ID); export const DataService = { async getAllData(): Promise { const accounts = (await AccountService.getAllAccounts()) as IAccountData[]; - let offset = 0, - personalInformationDocuments: Models.DocumentList; - do { - personalInformationDocuments = await database.listDocuments( - PERSONAL_INFORMATION_COLLECTION_ID, [], 100, offset); - personalInformationDocuments.documents.forEach(personalInformation => { - const account = accounts.find(account => account.accountNumber === personalInformation.accountNumber); - if(account) { - account.name = `${account.firstName} ${account.lastName}`; - account.birthday = personalInformation.birthday; - account.address = personalInformation.address; - account.contact = personalInformation.contact; - } - }, - ); - offset += 100; - } while(personalInformationDocuments.total > offset); + accounts.forEach(account => { + account.name = `${account.firstName} ${account.lastName}`; + }); + // let offset = 0, + // personalInformationDocuments: Models.DocumentList; + // do { + // personalInformationDocuments = await database.listDocuments( + // PERSONAL_INFORMATION_COLLECTION_ID, [], 100, offset); + // personalInformationDocuments.documents.forEach(personalInformation => { + // const account = accounts.find(account => account.accountNumber === personalInformation.accountNumber); + // if(account) { + // account.name = `${account.firstName} ${account.lastName}`; + // account.birthday = personalInformation.birthday; + // account.address = personalInformation.address; + // account.contact = personalInformation.contact; + // } + // }, + // ); + // offset += 100; + // } while(personalInformationDocuments.total > offset); return accounts; }, async addAccount(account: ICreateAccount): Promise { diff --git a/src/components/views/DataView.vue b/src/components/views/DataView.vue index 8889985..bbfa1a4 100644 --- a/src/components/views/DataView.vue +++ b/src/components/views/DataView.vue @@ -1,5 +1,20 @@