Skip to content
Snippets Groups Projects
Commit e8680ec4 authored by Rémi PAILHAREY's avatar Rémi PAILHAREY :fork_knife_plate:
Browse files

Merge branch 'dev' into 'master'

MEP animator role

See merge request !109
parents db439bfe 3be338c7
Branches
No related tags found
1 merge request!109MEP animator role
Pipeline #72279 passed
Showing with 133 additions and 106 deletions
...@@ -5,7 +5,8 @@ SSL_KEY_FILE=key.pem ...@@ -5,7 +5,8 @@ SSL_KEY_FILE=key.pem
# Common settings # Common settings
HOSTNAME=localhost HOSTNAME=localhost
ADMIN_ROLE= ANIMATOR_ROLE=ANIMATORS
ADMIN_ROLE=ADMINS
DEBUG_MODE= DEBUG_MODE=
MOCK_OAUTH2= MOCK_OAUTH2=
HTTPS_PORT= HTTPS_PORT=
......
{ {
"workbench.colorCustomizations": { "workbench.colorCustomizations": {
"activityBar.background": "#37cc4e", "activityBar.background": "#15161B",
"activityBar.activeBorder": "#7867d8", "activityBar.foreground": "#61F0F2",
"activityBar.foreground": "#15202b", "activityBar.inactiveForeground": "#61F0F277",
"activityBar.inactiveForeground": "#15202b99", "activityBar.activeBorder": "#DB8300",
"activityBarBadge.background": "#7867d8", "activityBarBadge.background": "#e41b62",
"activityBarBadge.foreground": "#e7e7e7", "activityBarBadge.foreground": "#e7e7e7",
"titleBar.activeBackground": "#2aa63d", "titleBar.activeBackground": "#15161B",
"titleBar.inactiveBackground": "#2aa63d99", "titleBar.inactiveBackground": "#15161B99",
"titleBar.activeForeground": "#e7e7e7", "titleBar.activeForeground": "#E0E0E0",
"titleBar.inactiveForeground": "#e7e7e799", "titleBar.inactiveForeground": "#61F0F277",
"statusBar.background": "#2aa63d", "tab.activeBorderTop": "#61F0F2",
"statusBarItem.hoverBackground": "#37cc4e", "tab.hoverBackground": "#61F0F211",
"statusBar.foreground": "#e7e7e7", "statusBar.background": "#15161B",
"activityBar.activeBackground": "#37cc4e", "statusBar.foreground": "#61F0F2AA",
"sash.hoverBorder": "#37cc4e", "statusBarItem.hoverBackground": "#61F0F233",
"statusBarItem.remoteBackground": "#2aa63d", "statusBarItem.remoteBackground": "#61F0F2",
"statusBarItem.remoteForeground": "#e7e7e7", "statusBarItem.remoteForeground": "#242633",
"commandCenter.border": "#e7e7e799" "focusBorder": "#61F0F2",
"badge.background": "#61F0F2",
"badge.foreground": "#15161B",
"button.background": "#61F0F2",
"button.foreground": "#15161B",
"button.hoverBackground": "#61F0F299"
}, },
"editor.formatOnSave": true, "editor.formatOnSave": true,
"eslint.format.enable": true, "eslint.format.enable": true,
......
# Ecolyo Agent Client # Ecolyo Agent Client
[check documentation here](https://doc.self-data.alpha.grandlyon.com/ecolyo-agent/technical/getting_started/#local-usage) [check documentation here](https://doc-self-data.apps.grandlyon.com/ecolyo-agent/technical/getting_started/#local-usage)
...@@ -54,6 +54,7 @@ services: ...@@ -54,6 +54,7 @@ services:
environment: environment:
- HOSTNAME=${HOSTNAME} - HOSTNAME=${HOSTNAME}
- HTTPS_PORT=${HTTPS_PORT} - HTTPS_PORT=${HTTPS_PORT}
- ANIMATOR_ROLE=${ANIMATOR_ROLE}
- ADMIN_ROLE=${ADMIN_ROLE} - ADMIN_ROLE=${ADMIN_ROLE}
- REDIRECT_URL=${REDIRECT_URL} - REDIRECT_URL=${REDIRECT_URL}
- CLIENT_ID=${CLIENT_ID} - CLIENT_ID=${CLIENT_ID}
......
...@@ -52,6 +52,7 @@ services: ...@@ -52,6 +52,7 @@ services:
environment: environment:
- HOSTNAME=${HOSTNAME} - HOSTNAME=${HOSTNAME}
- HTTPS_PORT=${HTTPS_PORT} - HTTPS_PORT=${HTTPS_PORT}
- ANIMATOR_ROLE=${ANIMATOR_ROLE}
- ADMIN_ROLE=${ADMIN_ROLE} - ADMIN_ROLE=${ADMIN_ROLE}
- REDIRECT_URL=${REDIRECT_URL} - REDIRECT_URL=${REDIRECT_URL}
- CLIENT_ID=${CLIENT_ID} - CLIENT_ID=${CLIENT_ID}
......
...@@ -25,7 +25,7 @@ server { ...@@ -25,7 +25,7 @@ server {
proxy_pass https://backend:1443/doc; proxy_pass https://backend:1443/doc;
} }
location /imageNames { location /imageNames {
proxy_pass https://backend:1443/api/admin/imageNames; proxy_pass https://backend:1443/api/animator/imageNames;
} }
location /assets { location /assets {
proxy_pass https://backend:1443/assets; proxy_pass https://backend:1443/assets;
......
...@@ -20,7 +20,7 @@ server { ...@@ -20,7 +20,7 @@ server {
proxy_pass https://backend:1443/Logout; proxy_pass https://backend:1443/Logout;
} }
location /imageNames { location /imageNames {
proxy_pass https://backend:1443/api/admin/imageNames; proxy_pass https://backend:1443/api/animator/imageNames;
} }
location /assets { location /assets {
proxy_pass https://backend:1443/assets; proxy_pass https://backend:1443/assets;
......
...@@ -12,11 +12,19 @@ const BottomBar: React.FC = () => { ...@@ -12,11 +12,19 @@ const BottomBar: React.FC = () => {
return ( return (
<div className="navbar"> <div className="navbar">
<div className="menu-list"> <div className="menu-list">
{routes.map((route) => ( {user &&
<NavLink key={route.label} to={route.path} activeClassName="active"> routes.map(
{route.label} (route) =>
</NavLink> (!route.adminOnly || user?.isAdmin) && (
))} <NavLink
key={route.label}
to={route.path}
activeClassName="active"
>
{route.label}
</NavLink>
)
)}
{process.env.NODE_ENV === 'development' && ( {process.env.NODE_ENV === 'development' && (
<a href="/doc/" target="_blank"> <a href="/doc/" target="_blank">
Swagger doc Swagger doc
......
...@@ -16,11 +16,19 @@ const SideBar: React.FC = () => { ...@@ -16,11 +16,19 @@ const SideBar: React.FC = () => {
<img src={logo} alt="Ecolyo logo" className="logo" /> <img src={logo} alt="Ecolyo logo" className="logo" />
</div> </div>
<div className="menu-list"> <div className="menu-list">
{routes.map((route) => ( {user &&
<NavLink key={route.label} to={route.path} activeClassName="active"> routes.map(
{route.label} (route) =>
</NavLink> (!route.adminOnly || user.isAdmin) && (
))} <NavLink
key={route.label}
to={route.path}
activeClassName="active"
>
{route.label}
</NavLink>
)
)}
{process.env.NODE_ENV === 'development' && ( {process.env.NODE_ENV === 'development' && (
<a href="/doc/" target="_blank"> <a href="/doc/" target="_blank">
Swagger doc Swagger doc
......
...@@ -7,7 +7,9 @@ import Newsletter from '../Newsletter/Newsletter' ...@@ -7,7 +7,9 @@ import Newsletter from '../Newsletter/Newsletter'
import Popups from '../Popups/Popups' import Popups from '../Popups/Popups'
import Prices from '../Prices/Prices' import Prices from '../Prices/Prices'
export const links: { [key: string]: { label: string; path: string } } = { export const links: {
[key: string]: { label: string; path: string; adminOnly?: boolean }
} = {
newsletter: { newsletter: {
label: 'Newsletter', label: 'Newsletter',
path: '/newsletter', path: '/newsletter',
...@@ -23,17 +25,18 @@ export const links: { [key: string]: { label: string; path: string } } = { ...@@ -23,17 +25,18 @@ export const links: { [key: string]: { label: string; path: string } } = {
consents: { consents: {
label: 'Consentements', label: 'Consentements',
path: '/consents', path: '/consents',
adminOnly: true,
}, },
} }
export const routes = Object.keys(links).map((key) => ({ export const routes = Object.keys(links).map((key) => ({
label: links[key].label, label: links[key].label,
path: links[key].path, path: links[key].path,
adminOnly: links[key].adminOnly,
})) }))
const Router: React.FC = () => { const Router: React.FC = () => {
const { user } = useContext(UserContext) const { user } = useContext(UserContext)
console.log(user)
return ( return (
<Switch> <Switch>
...@@ -42,7 +45,9 @@ const Router: React.FC = () => { ...@@ -42,7 +45,9 @@ const Router: React.FC = () => {
<Route exact path={links.newsletter.path} component={Newsletter} /> <Route exact path={links.newsletter.path} component={Newsletter} />
<Route exact path={links.prices.path} component={Prices} /> <Route exact path={links.prices.path} component={Prices} />
<Route exact path={links.popups.path} component={Popups} /> <Route exact path={links.popups.path} component={Popups} />
<Route exact path={links.consents.path} component={Consents} /> {user.isAdmin && (
<Route exact path={links.consents.path} component={Consents} />
)}
<Redirect path="*" to={links.newsletter.path} /> <Redirect path="*" to={links.newsletter.path} />
</> </>
) : ( ) : (
......
import { useContext, useState } from 'react'
import axios from 'axios' import axios from 'axios'
import { UserContext } from './userContext' import { useContext, useState } from 'react'
import { useHistory } from 'react-router-dom' import { useHistory } from 'react-router-dom'
import { links } from '../components/Routes/Router' import { links } from '../components/Routes/Router'
import { UserContext } from './userContext'
export interface Auth { export interface Auth {
loginUser: () => Promise<void> loginUser: () => Promise<void>
......
import { useState, useEffect } from 'react'
import axios from 'axios' import axios from 'axios'
import { User } from '../models/user.model' import { useEffect, useState } from 'react'
import { toast } from 'react-toastify' import { toast } from 'react-toastify'
import { User } from '../models/user.model'
const useFindUser = () => { const useFindUser = () => {
const [user, setUser] = useState<User | null>(null) const [user, setUser] = useState<User | null>(null)
...@@ -16,7 +16,7 @@ const useFindUser = () => { ...@@ -16,7 +16,7 @@ const useFindUser = () => {
setLoading(false) setLoading(false)
} }
} catch (error) { } catch (error) {
toast.error('Access denied, please login') toast.error('Accès refusé, veuillez vous connecter')
} }
} }
findUser() findUser()
......
import axios, { AxiosRequestConfig } from 'axios'
import { DateTime } from 'luxon'
import { toast } from 'react-toastify'
import { ConsentEntity, IConsent } from '../models/consent.model'
import { import {
ConsentPaginationEntity, ConsentPaginationEntity,
IConsentPagination, IConsentPagination,
} from './../models/consent.model' } from './../models/consent.model'
import axios, { AxiosRequestConfig } from 'axios'
import { ConsentEntity, IConsent } from '../models/consent.model'
import { toast } from 'react-toastify'
import { DateTime } from 'luxon'
export class ConsentService { export class ConsentService {
/** /**
...@@ -30,11 +30,9 @@ export class ConsentService { ...@@ -30,11 +30,9 @@ export class ConsentService {
return this.parseConsentPagination(consentPagination) return this.parseConsentPagination(consentPagination)
} catch (e: any) { } catch (e: any) {
if (e.response.status === 403) { if (e.response.status === 403) {
toast.error( toast.error("Accès refusé : vous n'avez pas les droits nécessaires")
"Unauthorized : You don't have the rights to do this operation"
)
} else { } else {
toast.error('Failed to get consents') toast.error('Erreur lors de la récupération des consentements')
} }
console.error(e) console.error(e)
return null return null
......
...@@ -14,7 +14,7 @@ export class CustomPopupService { ...@@ -14,7 +14,7 @@ export class CustomPopupService {
): Promise<void> => { ): Promise<void> => {
try { try {
await axios.put( await axios.put(
`/api/admin/customPopup`, `/api/animator/customPopup`,
{ {
...customPopup, ...customPopup,
}, },
......
...@@ -18,7 +18,7 @@ export class NewsletterService { ...@@ -18,7 +18,7 @@ export class NewsletterService {
): Promise<void> => { ): Promise<void> => {
try { try {
await axios.put( await axios.put(
`/api/admin/mailSubject`, `/api/animator/mailSubject`,
{ {
month: date.getMonth() + 1, month: date.getMonth() + 1,
year: date.getFullYear(), year: date.getFullYear(),
...@@ -26,14 +26,14 @@ export class NewsletterService { ...@@ -26,14 +26,14 @@ export class NewsletterService {
}, },
axiosHeaders axiosHeaders
) )
toast.success('Mail subject successfully saved !') toast.success('Objet de la newsletter enregistré !')
} catch (e: any) { } catch (e: any) {
if (e.response.status === 403) { if (e.response.status === 403) {
toast.error("Accès refusé : vous n'avez pas les droits nécessaires")
} else {
toast.error( toast.error(
"Unauthorized : You don't have the rights to do this operation" "Erreur lors de l’enregistrement de l'objet de la newsletter"
) )
} else {
toast.error('Failed to create mail subject')
} }
console.error(e) console.error(e)
} }
...@@ -50,7 +50,9 @@ export class NewsletterService { ...@@ -50,7 +50,9 @@ export class NewsletterService {
): Promise<IMailSubject | null> => { ): Promise<IMailSubject | null> => {
try { try {
const { data } = await axios.get( const { data } = await axios.get(
`/api/admin/mailSubject/${date.getFullYear()}/${date.getMonth() + 1}`, `/api/animator/mailSubject/${date.getFullYear()}/${
date.getMonth() + 1
}`,
axiosHeaders axiosHeaders
) )
return data as IMailSubject return data as IMailSubject
...@@ -71,17 +73,17 @@ export class NewsletterService { ...@@ -71,17 +73,17 @@ export class NewsletterService {
): Promise<void> => { ): Promise<void> => {
try { try {
await axios.delete( await axios.delete(
`/api/admin/mailSubject/${date.getFullYear()}/${date.getMonth() + 1}`, `/api/animator/mailSubject/${date.getFullYear()}/${
date.getMonth() + 1
}`,
axiosHeaders axiosHeaders
) )
toast.success('Mail subject successfully deleted !') toast.success('Objet de la newsletter supprimé !')
} catch (e: any) { } catch (e: any) {
if (e.response.status === 403) { if (e.response.status === 403) {
toast.error( toast.error("Accès refusé : vous n'avez pas les droits nécessaires")
"Unauthorized : You don't have the rights to do this operation"
)
} else { } else {
toast.error('Failed to delete mail subject') toast.error("Erreur lors de la suppression de l'objet de la newsletter")
} }
console.error(e) console.error(e)
} }
...@@ -100,7 +102,7 @@ export class NewsletterService { ...@@ -100,7 +102,7 @@ export class NewsletterService {
): Promise<void> => { ): Promise<void> => {
try { try {
await axios.put( await axios.put(
`/api/admin/monthlyInfo`, `/api/animator/monthlyInfo`,
{ {
month: date.getMonth() + 1, month: date.getMonth() + 1,
year: date.getFullYear(), year: date.getFullYear(),
...@@ -109,14 +111,12 @@ export class NewsletterService { ...@@ -109,14 +111,12 @@ export class NewsletterService {
}, },
axiosHeaders axiosHeaders
) )
toast.success('Monthly info successfully saved !') toast.success('Information du mois enregistrée !')
} catch (e: any) { } catch (e: any) {
if (e.response.status === 403) { if (e.response.status === 403) {
toast.error( toast.error("Accès refusé : vous n'avez pas les droits nécessaires")
"Unauthorized : You don't have the rights to do this operation"
)
} else { } else {
toast.error('Failed to create monthly info') toast.error('Erreur lors de l’enregistrement des informations du mois')
} }
console.error(e) console.error(e)
} }
...@@ -133,7 +133,9 @@ export class NewsletterService { ...@@ -133,7 +133,9 @@ export class NewsletterService {
): Promise<IMonthlyInfo | null> => { ): Promise<IMonthlyInfo | null> => {
try { try {
const { data } = await axios.get( const { data } = await axios.get(
`/api/admin/monthlyInfo/${date.getFullYear()}/${date.getMonth() + 1}`, `/api/animator/monthlyInfo/${date.getFullYear()}/${
date.getMonth() + 1
}`,
axiosHeaders axiosHeaders
) )
return data as IMonthlyInfo return data as IMonthlyInfo
...@@ -154,17 +156,17 @@ export class NewsletterService { ...@@ -154,17 +156,17 @@ export class NewsletterService {
): Promise<void> => { ): Promise<void> => {
try { try {
await axios.delete( await axios.delete(
`/api/admin/monthlyInfo/${date.getFullYear()}/${date.getMonth() + 1}`, `/api/animator/monthlyInfo/${date.getFullYear()}/${
date.getMonth() + 1
}`,
axiosHeaders axiosHeaders
) )
toast.success('Monthly info successfully deleted !') toast.success('Informations du mois supprimées !')
} catch (e: any) { } catch (e: any) {
if (e.response.status === 403) { if (e.response.status === 403) {
toast.error( toast.error("Accès refusé : vous n'avez pas les droits nécessaires")
"Unauthorized : You don't have the rights to do this operation"
)
} else { } else {
toast.error('Failed to delete monthly info') toast.error('Erreur lors de la suppression des informations du mois')
} }
console.error(e) console.error(e)
} }
...@@ -184,7 +186,7 @@ export class NewsletterService { ...@@ -184,7 +186,7 @@ export class NewsletterService {
): Promise<void> => { ): Promise<void> => {
try { try {
await axios.put( await axios.put(
`/api/admin/monthlyNews`, `/api/animator/monthlyNews`,
{ {
month: date.getMonth() + 1, month: date.getMonth() + 1,
year: date.getFullYear(), year: date.getFullYear(),
...@@ -193,14 +195,12 @@ export class NewsletterService { ...@@ -193,14 +195,12 @@ export class NewsletterService {
}, },
axiosHeaders axiosHeaders
) )
toast.success('Monthly news successfully saved !') toast.success('Nouveautés du mois enregistrés !')
} catch (e: any) { } catch (e: any) {
if (e.response.status === 403) { if (e.response.status === 403) {
toast.error( toast.error("Accès refusé : vous n'avez pas les droits nécessaires")
"Unauthorized : You don't have the rights to do this operation"
)
} else { } else {
toast.error('Failed to save monthly news') toast.error('Erreur lors de l’enregistrement des nouveautés du mois')
} }
console.error(e) console.error(e)
} }
...@@ -217,7 +217,9 @@ export class NewsletterService { ...@@ -217,7 +217,9 @@ export class NewsletterService {
): Promise<IMonthlyNews | null> => { ): Promise<IMonthlyNews | null> => {
try { try {
const { data } = await axios.get( const { data } = await axios.get(
`/api/admin/monthlyNews/${date.getFullYear()}/${date.getMonth() + 1}`, `/api/animator/monthlyNews/${date.getFullYear()}/${
date.getMonth() + 1
}`,
axiosHeaders axiosHeaders
) )
return data as IMonthlyNews return data as IMonthlyNews
...@@ -238,17 +240,17 @@ export class NewsletterService { ...@@ -238,17 +240,17 @@ export class NewsletterService {
): Promise<void> => { ): Promise<void> => {
try { try {
await axios.delete( await axios.delete(
`/api/admin/monthlyNews/${date.getFullYear()}/${date.getMonth() + 1}`, `/api/animator/monthlyNews/${date.getFullYear()}/${
date.getMonth() + 1
}`,
axiosHeaders axiosHeaders
) )
toast.success('Monthly news successfully deleted !') toast.success('Nouveautés du mois supprimées !')
} catch (e: any) { } catch (e: any) {
if (e.response.status === 403) { if (e.response.status === 403) {
toast.error( toast.error("Accès refusé : vous n'avez pas les droits nécessaires")
"Unauthorized : You don't have the rights to do this operation"
)
} else { } else {
toast.error('Failed to delete monthly news') toast.error('Erreur lors de la suppression des nouveautés du mois')
} }
console.error(e) console.error(e)
} }
...@@ -268,7 +270,7 @@ export class NewsletterService { ...@@ -268,7 +270,7 @@ export class NewsletterService {
): Promise<void> => { ): Promise<void> => {
try { try {
await axios.put( await axios.put(
`/api/admin/poll`, `/api/animator/poll`,
{ {
month: date.getMonth() + 1, month: date.getMonth() + 1,
year: date.getFullYear(), year: date.getFullYear(),
...@@ -277,14 +279,12 @@ export class NewsletterService { ...@@ -277,14 +279,12 @@ export class NewsletterService {
}, },
axiosHeaders axiosHeaders
) )
toast.success('Poll successfully saved !') toast.success('Sondage enregistré !')
} catch (e: any) { } catch (e: any) {
if (e.response.status === 403) { if (e.response.status === 403) {
toast.error( toast.error("Accès refusé : vous n'avez pas les droits nécessaires")
"Unauthorized : You don't have the rights to do this operation"
)
} else { } else {
toast.error('Failed to create poll') toast.error('Erreur lors de l’enregistrement du sondage')
} }
console.error(e) console.error(e)
} }
...@@ -301,7 +301,7 @@ export class NewsletterService { ...@@ -301,7 +301,7 @@ export class NewsletterService {
): Promise<IPoll | null> => { ): Promise<IPoll | null> => {
try { try {
const { data } = await axios.get( const { data } = await axios.get(
`/api/admin/poll/${date.getFullYear()}/${date.getMonth() + 1}`, `/api/animator/poll/${date.getFullYear()}/${date.getMonth() + 1}`,
axiosHeaders axiosHeaders
) )
return data as IPoll return data as IPoll
...@@ -322,17 +322,15 @@ export class NewsletterService { ...@@ -322,17 +322,15 @@ export class NewsletterService {
): Promise<void> => { ): Promise<void> => {
try { try {
await axios.delete( await axios.delete(
`/api/admin/poll/${date.getFullYear()}/${date.getMonth() + 1}`, `/api/animator/poll/${date.getFullYear()}/${date.getMonth() + 1}`,
axiosHeaders axiosHeaders
) )
toast.success('Poll successfully deleted !') toast.success('Sondage supprimé !')
} catch (e: any) { } catch (e: any) {
if (e.response.status === 403) { if (e.response.status === 403) {
toast.error( toast.error("Accès refusé : vous n'avez pas les droits nécessaires")
"Unauthorized : You don't have the rights to do this operation"
)
} else { } else {
toast.error('Failed to delete poll') toast.error('Erreur lors de la suppression du sondage')
} }
console.error(e) console.error(e)
} }
...@@ -346,7 +344,7 @@ export class NewsletterService { ...@@ -346,7 +344,7 @@ export class NewsletterService {
): Promise<string[]> => { ): Promise<string[]> => {
try { try {
const { data: imageNames } = await axios.get( const { data: imageNames } = await axios.get(
`/api/admin/imageNames`, `/api/animator/imageNames`,
axiosHeaders axiosHeaders
) )
if (imageNames && imageNames !== null) { if (imageNames && imageNames !== null) {
......
import axios, { AxiosRequestConfig } from 'axios' import axios, { AxiosRequestConfig } from 'axios'
import { IPartnersInfo } from '../models/partnersInfo.model'
import { toast } from 'react-toastify' import { toast } from 'react-toastify'
import { IPartnersInfo } from '../models/partnersInfo.model'
export class PartnersInfoService { export class PartnersInfoService {
/** /**
* Save the partnersInfo * Save the partnersInfo
...@@ -13,7 +13,7 @@ export class PartnersInfoService { ...@@ -13,7 +13,7 @@ export class PartnersInfoService {
): Promise<void> => { ): Promise<void> => {
try { try {
await axios.put( await axios.put(
`/api/admin/partnersInfo`, `/api/animator/partnersInfo`,
{ {
grdf_failure: partnersInfo.grdf_failure, grdf_failure: partnersInfo.grdf_failure,
enedis_failure: partnersInfo.enedis_failure, enedis_failure: partnersInfo.enedis_failure,
...@@ -24,7 +24,9 @@ export class PartnersInfoService { ...@@ -24,7 +24,9 @@ export class PartnersInfoService {
) )
toast.success('Information des partenaires mises à jour !') toast.success('Information des partenaires mises à jour !')
} catch (e) { } catch (e) {
toast.error('Failed to save partners info') toast.error(
'Erreur lors de la mise à jour des information des partenaires'
)
console.error(e) console.error(e)
} }
} }
......
...@@ -12,10 +12,10 @@ export class PricesService { ...@@ -12,10 +12,10 @@ export class PricesService {
axiosHeaders: AxiosRequestConfig axiosHeaders: AxiosRequestConfig
): Promise<void> => { ): Promise<void> => {
try { try {
await axios.put(`/api/admin/prices`, price, axiosHeaders) await axios.put(`/api/animator/prices`, price, axiosHeaders)
toast.success('Price successfully saved !') toast.success('Prix des fluides mis à jour !')
} catch (e) { } catch (e) {
toast.error('Failed to save price') toast.error('Erreur lors de la mise à jour des prix des fluides')
console.error(e) console.error(e)
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment