Skip to content

Commit

Permalink
Revert "Merge pull request #125 from Badhan-BUET-Zone/test-branch"
Browse files Browse the repository at this point in the history
This reverts commit 40758dc, reversing
changes made to eb6d499.
  • Loading branch information
mirmahathir1 committed Apr 4, 2024
1 parent 40758dc commit 70326d2
Show file tree
Hide file tree
Showing 13 changed files with 43 additions and 228 deletions.
27 changes: 0 additions & 27 deletions package-lock.json

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

2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,13 @@
"axios": "^1.2.1",
"bootstrap": "^5.2.3",
"bootstrap-vue": "^2.23.1",
"chart.js": "^4.4.2",
"core-js": "^3.8.3",
"file-saver": "^2.0.5",
"lodash": "^4.17.21",
"register-service-worker": "^1.7.2",
"roboto-fontface": "*",
"stream": "^0.0.2",
"vue": "^2.6.14",
"vue-chartjs": "^5.3.0",
"vue-clipboard2": "^0.3.3",
"vue-fragment": "^1.6.0",
"vue-markdown": "^2.2.4",
Expand Down
9 changes: 0 additions & 9 deletions src/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,14 +204,6 @@ const handleGETLogs = async () => {
}
}

const handleGETLogsDonations = async () => {
try {
return await badhanAxios.get('/log/donations')
} catch (e) {
return (e as BadhanAxiosErrorInterface<BadhanAxiosResponseDataInterface>).response
}
}

type DELETESignOutResponseData = BadhanAxiosResponseDataInterface
const handleDELETESignOut = async () => {
try {
Expand Down Expand Up @@ -574,7 +566,6 @@ export {
handlePOSTDonorsPasswordRequest,
handleGETDonorsDuplicate,
handleGETLogs,
handleGETLogsDonations,
handleDELETESignOut,
handleDELETESignOutAll,
handlePOSTRedirection,
Expand Down
22 changes: 0 additions & 22 deletions src/localDatabase/donationCountYearMonth.ts

This file was deleted.

15 changes: 15 additions & 0 deletions src/localDatabase/emailRecovery.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
const save = () => {
localStorage.setItem('passwordEmailRecoveryTimestamp', String(new Date().getTime()))
}
const load = () => {
const result = localStorage.getItem('passwordEmailRecoveryTimestamp')
if (!result) return null
return parseInt(result)
}
const clear = () => {
localStorage.removeItem('passwordEmailRecoveryTimestamp')
}

export default {
save, load, clear
}
4 changes: 2 additions & 2 deletions src/localDatabase/frontendSettings.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { setWithExpiry, getWithExpiry, remove } from '@/localDatabase/helpers'
import { setWithExpiry, getWithExpiry } from '@/localDatabase/helpers'
const save = (frontendSettings: {version: string}) => {
setWithExpiry('frontendSettings', frontendSettings, 60 * 1000)
}
const load = () => {
return getWithExpiry('frontendSettings')
}
const clear = () => {
remove('frontendSettings')
localStorage.removeItem('frontendSettings')
}

export default {
Expand Down
4 changes: 0 additions & 4 deletions src/localDatabase/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ export const setWithExpiry = (key: string, value: unknown, ttl: number) => {
localStorage.setItem(key, JSON.stringify(item))
}

export const remove = (key: string) => {
localStorage.removeItem(key)
}

export const set = (key: string, value: unknown) =>{
localStorage.setItem(key, JSON.stringify({value}))
}
Expand Down
4 changes: 2 additions & 2 deletions src/localDatabase/index.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import emailRecovery from './emailRecovery'
import token from './token'
import theme from './theme'
import members from './members'
import publicContacts from './publicContacts'
import frontendSettings from './frontendSettings'
import myProfile from "./myProfile";
import donationCountYearMonth from './donationCountYearMonth'
const reset = () => {
localStorage.clear()
}

export default {
emailRecovery,
token,
theme,
members,
publicContacts,
frontendSettings,
myProfile,
donationCountYearMonth,
reset
}
4 changes: 2 additions & 2 deletions src/localDatabase/members.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { setWithExpiry, getWithExpiry, remove } from './helpers'
import { setWithExpiry, getWithExpiry } from './helpers'
import {MemberAPIResponseInterface} from "@/store/members";
const save = (members: MemberAPIResponseInterface) => {
setWithExpiry('members', members, 60 * 1000)
Expand All @@ -7,7 +7,7 @@ const load = () => {
return getWithExpiry('members')
}
const clear = () => {
remove('members')
localStorage.removeItem('members')
}

export default {
Expand Down
4 changes: 2 additions & 2 deletions src/localDatabase/myProfile.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { set, get, remove } from '@/localDatabase/helpers'
import { set, get } from '@/localDatabase/helpers'
import {MyProfileStateInterface} from "@/store/myprofile";

const storeKey = 'myProfile'
Expand All @@ -9,7 +9,7 @@ const load = () => {
return get(storeKey)
}
const clear = () => {
remove(storeKey)
localStorage.removeItem(storeKey)
}

export default {
Expand Down
4 changes: 2 additions & 2 deletions src/localDatabase/publicContacts.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { setWithExpiry, getWithExpiry, remove } from './helpers'
import { setWithExpiry, getWithExpiry } from './helpers'
import {PublicContactInterface} from "@/store/publicContacts";
const save = (members: PublicContactInterface[]) => {
setWithExpiry('publicContacts', members, 60 * 1000)
Expand All @@ -7,7 +7,7 @@ const load = () => {
return getWithExpiry('publicContacts')
}
const clear = () => {
remove('publicContacts')
localStorage.removeItem('publicContacts')
}

export default {
Expand Down
Loading

0 comments on commit 70326d2

Please sign in to comment.