Skip to content

Commit

Permalink
Merge pull request #34 from td1128/revert-14-hatif
Browse files Browse the repository at this point in the history
Revert "transaction page and related components "
  • Loading branch information
hatif03 authored Jul 22, 2024
2 parents d9b59aa + c4a3ac7 commit b06b9f5
Show file tree
Hide file tree
Showing 95 changed files with 4,053 additions and 4,078 deletions.
3 changes: 1 addition & 2 deletions .env
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
VITE_APP_API_URL=https://library-management-system-ce6z.onrender.com
VITE_APP_COMMON_PATH="api/common"
VITE_APP_ADMIN_PATH="api/admin"
VITE_APP_USER_PATH="api/user"
VITE_APP_USER_ROOT_URL=https://library-management-system-f9gh.onrender.com/api/user
VITE_APP_GET_USER_DETAILS=profile/
VITE_APP_USER_ROOT_URL_2=https://library-management-system-ce6z.onrender.com/api/user
363 changes: 183 additions & 180 deletions package-lock.json

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
"bootstrap": "^5.3.3",
"dayjs": "^1.11.11",
"gh-pages": "^6.1.1",
"ag-grid-react": "^31.3.2",
"react": "^18.2.0",
"react-bootstrap": "^2.10.3",
"react-dom": "^18.2.0",
Expand Down
84 changes: 42 additions & 42 deletions src/App.css
Original file line number Diff line number Diff line change
@@ -1,42 +1,42 @@
#root {
display: flex;
flex-direction: column;
flex-grow: 1;
width: fit-content;
}

/*.logo {
height: 6em;
padding: 1.5em;
will-change: filter;
transition: filter 300ms;
}
.logo:hover {
filter: drop-shadow(0 0 2em #646cffaa);
}
.logo.react:hover {
filter: drop-shadow(0 0 2em #61dafbaa);
}
@keyframes logo-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
@media (prefers-reduced-motion: no-preference) {
a:nth-of-type(2) .logo {
animation: logo-spin infinite 20s linear;
}
}
.card {
padding: 2em;
}
.read-the-docs {
color: #888;
}*/
#root {
display: flex;
flex-direction: column;
flex-grow: 1;
/* width: fit-content; */
}

/*.logo {
height: 6em;
padding: 1.5em;
will-change: filter;
transition: filter 300ms;
}
.logo:hover {
filter: drop-shadow(0 0 2em #646cffaa);
}
.logo.react:hover {
filter: drop-shadow(0 0 2em #61dafbaa);
}
@keyframes logo-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
@media (prefers-reduced-motion: no-preference) {
a:nth-of-type(2) .logo {
animation: logo-spin infinite 20s linear;
}
}
.card {
padding: 2em;
}
.read-the-docs {
color: #888;
}*/
15 changes: 0 additions & 15 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ import './App.css'
import 'bootstrap/dist/css/bootstrap.min.css'
import { Toaster } from 'react-hot-toast';

import { ToastContainer } from 'react-toastify';
import 'react-toastify/dist/ReactToastify.css';


import Books from './pages/user/Books_catalog/Books'

Expand All @@ -19,18 +16,6 @@ function App() {
<BrowserRouter basename="/Library_Management_System">
<Routers />
</BrowserRouter>
<ToastContainer
position="top-right"
autoClose={5000}
hideProgressBar={false}
newestOnTop={false}
closeOnClick
rtl={false}
pauseOnFocusLoss
draggable
pauseOnHover
theme="light"
/>
</Provider>
<Toaster/>
</>
Expand Down
16 changes: 16 additions & 0 deletions src/api/fetchUserDetails.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import axios from 'axios';

const fetchUserDetails = async ( studentID ) => {
const userRootUrl = import.meta.env.VITE_APP_USER_ROOT_URL;
const getUserDetails = import.meta.env.VITE_APP_GET_USER_DETAILS;

try {
const response = await axios.get( `${userRootUrl}/${getUserDetails}/${studentID}` );
console.log( response )
return response.data;
} catch ( error ) {
console.log( error.message );
}
}

export default fetchUserDetails;
24 changes: 24 additions & 0 deletions src/api/getLibraryCards.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import axios from 'axios';

const getLibraryCards = async ( membershipId ) => {
const userRootUrl = import.meta.env.VITE_APP_USER_ROOT_URL_2;
const getLibraryCardsUrl = import.meta.env.VITE_APP_GET_LIBRARY_CARDS;

try {
const response = await axios.get( `${ userRootUrl }/${ getLibraryCardsUrl }/${ membershipId }` );
return response.data;
} catch (error) {
if (error.response) {
console.error('Error response:', error.response.data);
throw new Error(error.response.data.message || 'Error getting the library cards');
} else if (error.request) {
console.error('Error request:', error.request);
throw new Error('No response received while getting the library cards');
} else {
console.error('Error message:', error.message);
throw new Error(error.message || 'Error getting the library cards');
}
}
}

export default getLibraryCards;
18 changes: 6 additions & 12 deletions src/api/index.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
import axios from 'axios';

const fetchUserDetails = async ( studentID ) => {
const userRootUrl = import.meta.env.VITE_APP_USER_ROOT_URL;
const getUserDetails = import.meta.env.VITE_APP_GET_USER_DETAILS;

const res = await axios.get( `${userRootUrl}/${getUserDetails}/${studentID}` );
console.log( res )
return res.data;
}

export { fetchUserDetails };
import fetchUserDetails from "./fetchUserDetails";
import updateUserDetails from "./updateUserDetails";
import updateFavSubject from "./updateFavSubject";
import getLibraryCards from "./getLibraryCards";

export { fetchUserDetails, updateUserDetails, updateFavSubject, getLibraryCards };
24 changes: 24 additions & 0 deletions src/api/updateFavSubject.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import axios from 'axios';

const updateFavSubject = async (membershipId, subjects) => {
const userRootUrl = import.meta.env.VITE_APP_USER_ROOT_URL_2;
const addSubUrl = import.meta.env.VITE_APP_UPDATE_USER_SUBJECT;

try {
const response = await axios.put(`${userRootUrl}/${addSubUrl}/${membershipId}`, { sub_list: subjects });
return response.data;
} catch (error) {
if (error.response) {
console.error('Error response:', error.response.data);
throw new Error(error.response.data.message || 'Error updating favorite subjects');
} else if (error.request) {
console.error('Error request:', error.request);
throw new Error('No response received while updating favorite subjects');
} else {
console.error('Error message:', error.message);
throw new Error(error.message || 'Error updating favorite subjects');
}
}
};

export default updateFavSubject;
15 changes: 15 additions & 0 deletions src/api/updateUserDetails.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import axios from 'axios';

const updateUserDetails = async ( studentDetails ) => {
const userRootUrl = import.meta.env.VITE_APP_USER_ROOT_URL;
const updateUrl = import.meta.env.VITE_APP_UPDATE_USER_DETAILS;

try {
const response = await axios.put( `${ userRootUrl }/${ updateUrl }`, studentDetails );
console.log( response );
} catch ( error ) {
console.log( error.message );
}
}

export default updateUserDetails;
24 changes: 13 additions & 11 deletions src/app/store.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import { configureStore } from '@reduxjs/toolkit';
import { statsReducer, searchBookReducer } from '../features';
import RelatedBookReducer from '../features/relatedBoolReducer/RelatedBookReducer';

export const store = configureStore({
reducer: {
stats: statsReducer,
relatedBookList: RelatedBookReducer,
searchBookList: searchBookReducer,
},
});
import { configureStore } from '@reduxjs/toolkit';
import { statsReducer, searchBookReducer, userSliceReducer,recomendedBookReducer } from '../features';
import RelatedBookReducer from '../features/relatedBoolReducer/RelatedBookReducer';

export const store = configureStore({
reducer: {
user: userSliceReducer,
stats: statsReducer,
relatedBookList: RelatedBookReducer,
recomendedBookList:recomendedBookReducer,
searchBookList: searchBookReducer,
},
});
Binary file added src/assets/icons/arrow-down-white.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/icons/close-eye-password.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/assets/icons/infinity-loader.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/icons/open-eye-password.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 0 additions & 5 deletions src/assets/style/style.css
Original file line number Diff line number Diff line change
@@ -1,5 +0,0 @@
.horizontal-scroll-container {
overflow-x: auto;
margin-bottom: 15px;
position: relative;
}
16 changes: 8 additions & 8 deletions src/common_components/Navbar/Navbar.css
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
.navbar {
@apply flex flex-col justify-start bg-gray-200 ml-4 mr-10 mb-8 pt-4 w-40 rounded-md text-base;
}

.navbar_title {
@apply text-2xl font-bold whitespace-nowrap;
color: #666666
}
.navbar {
@apply flex flex-col justify-start bg-gray-200 ml-4 mr-10 mb-8 pt-4 w-40 rounded-md text-base;
}

.navbar_title {
@apply text-2xl font-bold whitespace-nowrap;
color: #666666
}
Loading

0 comments on commit b06b9f5

Please sign in to comment.