diff --git a/.env b/.env index ffc7d42..0e603ab 100644 --- a/.env +++ b/.env @@ -2,5 +2,7 @@ VITE_BACKEND=http://localhost:4320/api/ # VITE_BACKEND=https://ocboapps.davaocity.gov.ph/esign-server/api/ # VITE_BACKEND=http://192.168.7.163/server/api/ +VITE_HEAD=ARCH. KHASHAYAR L. TOGHYANI VITE_PESO=₱ +VITE_HEADID=276 VITE_PUBLICIP=58.69.136.59 \ No newline at end of file diff --git a/backend/main.go b/backend/main.go index 88e6164..bcef4a2 100644 --- a/backend/main.go +++ b/backend/main.go @@ -434,17 +434,6 @@ func connect() { "result": result, }) - case "get-headid": - err = db.QueryRow("SELECT IFNULL(employeeid, '') AS result FROM employee WHERE is_head = 1").Scan(&result) - if err != nil { - c.AbortWithError(http.StatusBadRequest, err) - c.String(http.StatusBadRequest, err.Error()) - return - } - c.JSON(http.StatusOK, gin.H{ - "result": result, - }) - } }) diff --git a/src/pages/IndexPage/Index.tsx b/src/pages/IndexPage/Index.tsx index 01613a8..68cdad0 100644 --- a/src/pages/IndexPage/Index.tsx +++ b/src/pages/IndexPage/Index.tsx @@ -12,7 +12,6 @@ import './Index.sass' let assessorsNameList: string[] let registeredNameList: string[] let headName: string -let headId: string export default () => { const getAssessors = async () => { @@ -29,17 +28,11 @@ export default () => { } const getHead = async () => { - const response = await getApi('get-headname') - headName = response + const head = await getApi('get-headname') + headName = head sessionStorage.setItem('head', headName) } - const getHeadId = async () => { - const response = await getApi('get-headid') - headId = response - sessionStorage.setItem('headid', headId) - } - const clearCache = async () => { caches.keys() } @@ -49,7 +42,6 @@ export default () => { await getAssessors() await getRegistered() await getHead() - await getHeadId() }) return ( diff --git a/src/pages/MainPage/Main.tsx b/src/pages/MainPage/Main.tsx index 71bc716..3a88be0 100644 --- a/src/pages/MainPage/Main.tsx +++ b/src/pages/MainPage/Main.tsx @@ -13,7 +13,8 @@ import { Show } from 'solid-js/web' import './Main.sass' const PESO = import.meta.env.VITE_PESO -const ID = sessionStorage.get('headid') +const ID = import.meta.env.VITE_HEADID +// const NAME = import.meta.env.VITE_HEAD const PUBLICIP = import.meta.env.VITE_PUBLICIP export default () => { diff --git a/src/pages/RegisterPage/Register.tsx b/src/pages/RegisterPage/Register.tsx index 2624ffc..5aff5ae 100644 --- a/src/pages/RegisterPage/Register.tsx +++ b/src/pages/RegisterPage/Register.tsx @@ -10,7 +10,7 @@ import { checkConnection, getApi, postApi } from '../../utils/functions' import './Register.sass' export default () => { - const APPROVERNAME = sessionStorage.getItem('head') + const APPROVERNAME = import.meta.env.VITE_HEAD const assessors = JSON.parse(sessionStorage.getItem('assessors')!) const roles = ['ASSESSOR', 'APPROVER']