Compare commits

..

9 Commits

Author SHA1 Message Date
victorAnumudu 3584447c65 fixed footer year 2025-06-27 19:48:18 +01:00
ameye 58cd232f91 Merge branch 'token-uid-payload' of MERMS/MermsPanelReactJS into master 2025-06-26 19:03:07 +00:00
victorAnumudu 9684e7fcfa added token and uid to all endpoints 2025-06-26 17:37:11 +01:00
ameye d4eda11477 Merge branch 'products-endpont' of MERMS/MermsPanelReactJS into master 2025-06-25 19:55:14 +00:00
victorAnumudu 1d31507984 new products endpoint added 2025-06-25 19:31:50 +01:00
ameye a3dbc8cab1 Merge branch 'location-reload' of MERMS/MermsPanelReactJS into master 2025-06-25 13:08:28 +00:00
victorAnumudu 29878e3ddf fix location reload error 2025-06-25 13:06:32 +01:00
CHIEFSOFT\ameye 80a40da9df dev .env 2025-06-24 15:57:41 -04:00
ameye 9f7f1b706b Merge branch 'product-endpoint' of MERMS/MermsPanelReactJS into master 2025-06-24 16:18:58 +00:00
7 changed files with 101 additions and 70 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
SKIP_PREFLIGHT_CHECK=true
REACT_APP_NODE_ENV="development"
REACT_APP_SOCKET_URL="https://dev-socket.mermsemr.com"
REACT_APP_SOCKET_URL="https://devsocket.mermsemr.com"
REACT_APP_MAIN_API="https://devapi.mermsemr.com"
REACT_APP_MEDIA_SERVER="https://dev-media.mermsemr.com"
REACT_APP_MAIN_SOCKET="https://dev-socket.mermsemr.com"
+1 -1
View File
@@ -1,6 +1,6 @@
SKIP_PREFLIGHT_CHECK=true
REACT_APP_NODE_ENV="development"
REACT_APP_SOCKET_URL="https://dev-socket.mermsemr.com"
REACT_APP_SOCKET_URL="https://devsocket.mermsemr.com"
REACT_APP_MAIN_API="https://devapi.mermsemr.com"
REACT_APP_MEDIA_SERVER="https://dev-media.mermsemr.com"
REACT_APP_MAIN_SOCKET="https://dev-socket.mermsemr.com"
+2 -1
View File
@@ -11,7 +11,8 @@ export default function BearerToken() {
return userToken(fields)
},
onError: (error) => {
location.reload();
console.log(error)
// window.location.reload(true)
},
onSuccess: (res) => {
if(res?.data?.resultCode != '0'){
+30 -25
View File
@@ -1,29 +1,34 @@
import { useQuery } from '@tanstack/react-query'
import React from 'react'
import { productData } from '../../services/services'
import queryKeys from '../../services/queryKeys'
import React, {useEffect} from 'react'
import { useMutation } from '@tanstack/react-query'
import { productsData } from '../../services/services'
import productPath from "../../utils/productpath";
import { Link } from 'react-router-dom';
export default function Products() {
const {data, isFetching, isError, error} = useQuery({
queryKey: queryKeys.product,
queryFn: () => productData()
export default function Products() {
const getProductsData = useMutation({
mutationFn: (reqData) => {
return productsData(reqData)
},
onError: (error) => {
console.log(error)
},
onSuccess: (res) => {
if(res?.data?.resultCode != '0'){
throw({message: 'Something went wrong'})
}
}
})
/*
{
"banner": "p1.jpg",
"description": "Your personal professional web presence",
"id": 1,
"name": "Personal Website",
"product_id": "A000001",
"product_uid": "e92282b4-3ee1-4026-92ac-12cfd214b43a",
"status": 5,
"status_text": "Activate Now"
},
*/
//const products = data?.data?.products_list?.products
const products = data?.data?.products_list
useEffect(()=>{
let reqData = {
token: localStorage.getItem('token'), // USER TOKEN
uid: localStorage.getItem('uid') // USER UID
}
getProductsData.mutate(reqData)
},[])
const products = getProductsData?.data?.data?.products_data // PRODUCTS DATA
return (
<>
@@ -32,7 +37,7 @@ export default function Products() {
<h4 className="card-title">My Products</h4>
</div>
<div className="card-body pb-0">
{isFetching ?
{getProductsData?.isPending ?
<>
<div className="row">
<div className="col-12">
@@ -40,10 +45,10 @@ export default function Products() {
</div>
</div>
</>
: isError ?
: getProductsData?.isPending ?
<div className="row">
<div className="col-12">
<p className='text-danger'>{error.message}</p>
<p className='text-danger'>{getProductsData?.error?.message}</p>
</div>
</div>
:
-1
View File
@@ -10,7 +10,6 @@ export default function TopBar() {
},
onError: (error) => {
console.log(error)
location.reload();
},
onSuccess: (res) => {
if(res?.data?.resultCode != '0'){
@@ -2,11 +2,13 @@ import React from "react";
export default function UserFooter(){
const year = new Date().getFullYear()
return <>
<footer className="footer">
<div className="row">
<div className="col-12 col-sm-6 text-center text-sm-left">
<p>&copy; Copyright 2024. All rights reserved.</p>
<p>&copy; Copyright {year}. All rights reserved.</p>
</div>
<div className="col col-sm-6 ml-sm-auto text-center text-sm-right">
<p>A division of <i className="fa fa-key text-danger mx-1"></i> autoMedSys A.I.</p>
+64 -40
View File
@@ -43,7 +43,7 @@ const getAuxEnd = (path, reqData= null) => {
})
}
// FUNCTION TO LOGIN USER IN
// FUNCTION TO AUTHORIZE USER IN
export const userToken = (reqData) => {
let postData = {
...reqData
@@ -67,11 +67,29 @@ export const userInfo = (reqData) => {
return postAuxEnd('/panel/account', postData, false)
}
// FUNCTION TO GET DASHBOARD TOP BAR SECTION
export const topBar = (reqData) => {
let postData = {
...reqData,
}
return postAuxEnd(`/panel/account/bar`, postData, false)
}
// FUNCTION TO GET DASHBOARD RECENT ACTIONS SECTION
export const recentActions = (reqData) => {
let postData = {
...reqData,
token: localStorage.getItem('token'), // USER TOKEN
uid: localStorage.getItem('uid') // USER UID
}
//return getAuxEnd(`/panel/account/actions`)
return postAuxEnd(`/panel/account/actions`, postData, false)
}
// FUNCTION TO GET DASHBOARD PRODUCT DATA SECTION
export const productData = () => {
let postData = {
"token":"b",
"uid": 'h'
export const productsData = (reqData) => {
let postData = {
...reqData,
}
return postAuxEnd(`/panel/account/products`, postData, false)
}
@@ -80,6 +98,17 @@ export const productData = () => {
// FUNCTION TO GET DASHBOARD PRODUCT URL DATA SECTION
export const productsURL = (reqData) => {
let postData = {
...reqData,
token: localStorage.getItem('token'), // USER TOKEN
uid: localStorage.getItem('uid') // USER UID
}
return postAuxEnd(`/panel/account/products/url`, postData, false)
// return getAuxEnd(`/panel/account/products/url`)
}
// FUNCTION TO REGISTER USER
export const signUpUser = (reqData) => {
let postData = {
@@ -107,9 +136,11 @@ export const completeRegistration = (reqData) => {
// FUNCTION TO SUBSCRIBE
export const subscribe = (reqData) => {
let postData = {
...reqData
...reqData,
token: localStorage.getItem('token'), // USER TOKEN
uid: localStorage.getItem('uid') // USER UID
}
return postAuxEnd('/panel/myproduct/subscription', postData, false)
return postAuxEnd(`/panel/myproduct/subscription`, postData, false)
}
@@ -121,52 +152,45 @@ export const recoverPWD = (reqData) => {
return postAuxEnd('/panel/auth/reset', postData, false)
}
// FUNCTION TO GET DASHBOARD TOP BAR SECTION
export const topBar = (reqData) => {
// FUNCTION TO GET CALENDAR EVENTS
export const getCalendarEvents = (reqData) => {
let postData = {
...reqData,
// "token":"there-will-be-token",
// "uid": "there-will-be-uid"
}
return postAuxEnd(`/panel/account/bar`, postData, false)
}
// FUNCTION TO GET CALENDAR EVENTS
export const getCalendarEvents = () => {
// return getAuxEnd(`/panel/account/calendar`)
let postData = {
"a":"b"
token: localStorage.getItem('token'), // USER TOKEN
uid: localStorage.getItem('uid') // USER UID
}
return postAuxEnd(`/panel/account/calendar`, postData, false)
}
// FUNCTION TO GET DASHBOARD RECENT ACTIONS SECTION
export const recentActions = () => {
//return getAuxEnd(`/panel/account/actions`)
let postData = {
"a":"b"
}
return postAuxEnd(`/panel/account/actions`, postData, false)
}
// FUNCTION TO GET MY PRODUCT PROVISION DATA
export const productProvision = (reqData) => {
const postData = { ...reqData }
return getAuxEnd(`/panel/myproduct/provision`, postData)
let postData = {
...reqData,
token: localStorage.getItem('token'), // USER TOKEN
uid: localStorage.getItem('uid') // USER UID
}
return postAuxEnd(`/panel/myproduct/provision`, postData, false)
// return getAuxEnd(`/panel/myproduct/provision`, postData)
}
// FUNCTION TO GET DASHBOARD PRODUCT DATA SECTION
export const contactData = () => {
return getAuxEnd(`/panel/contacts`)
}
// FUNCTION TO GET DASHBOARD PRODUCT URL DATA SECTION
export const productsURL = () => {
return getAuxEnd(`/panel/account/products/url`)
export const contactData = (reqData) => {
let postData = {
...reqData,
token: localStorage.getItem('token'), // USER TOKEN
uid: localStorage.getItem('uid') // USER UID
}
return postAuxEnd(`/panel/contacts`, postData, false)
// return getAuxEnd(`/panel/contacts`)
}
export const MyProductData = (productID) => {
const reqData = { product_id : productID}
//console.log(reqData)
return getAuxEnd(`/panel/myproduct/dash`,reqData)
let postData = {
...reqData,
token: localStorage.getItem('token'), // USER TOKEN
uid: localStorage.getItem('uid') // USER UID
}
return postAuxEnd(`/panel/myproduct/dash`, postData, false)
// return getAuxEnd(`/panel/myproduct/dash`,reqData)
}