Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
backoffice_client
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
web-et-numerique
Factory
LLLE_Project
backoffice_client
Commits
5df2fbd4
Commit
5df2fbd4
authored
3 years ago
by
Guilhem CARRON
Browse files
Options
Downloads
Patches
Plain Diff
feat: Handle 403 errors from server
parent
08177968
No related branches found
No related tags found
3 merge requests
!24
fix(typo): écogestes + optionnel poll
,
!22
feat: Add partners issue info
,
!16
feat: Handle 403 errors from server
Pipeline
#16948
passed
3 years ago
Stage: build
Stage: quality
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/services/newsletter.service.ts
+49
-13
49 additions, 13 deletions
src/services/newsletter.service.ts
with
49 additions
and
13 deletions
src/services/newsletter.service.ts
+
49
−
13
View file @
5df2fbd4
...
@@ -31,8 +31,14 @@ export class NewsletterService {
...
@@ -31,8 +31,14 @@ export class NewsletterService {
}
}
)
)
toast
.
success
(
'
Monthly info succesfully saved !
'
)
toast
.
success
(
'
Monthly info succesfully saved !
'
)
}
catch
(
e
)
{
}
catch
(
e
:
any
)
{
toast
.
error
(
'
Failed to create monthly info
'
)
if
(
e
.
response
.
status
===
403
)
{
toast
.
error
(
"
Unauthorized : You don't have the rights to do this operation
"
)
}
else
{
toast
.
error
(
'
Failed to create monthly info
'
)
}
console
.
error
(
e
)
console
.
error
(
e
)
}
}
}
}
...
@@ -56,7 +62,7 @@ export class NewsletterService {
...
@@ -56,7 +62,7 @@ export class NewsletterService {
}
}
)
)
return
data
as
IMonthlyInfo
return
data
as
IMonthlyInfo
}
catch
(
e
)
{
}
catch
(
e
:
any
)
{
console
.
error
(
'
error
'
,
e
)
console
.
error
(
'
error
'
,
e
)
return
null
return
null
}
}
...
@@ -81,8 +87,14 @@ export class NewsletterService {
...
@@ -81,8 +87,14 @@ export class NewsletterService {
}
}
)
)
toast
.
success
(
'
Monthly info succesfully deleted !
'
)
toast
.
success
(
'
Monthly info succesfully deleted !
'
)
}
catch
(
e
)
{
}
catch
(
e
:
any
)
{
toast
.
error
(
'
Failed to delete monthly info
'
)
if
(
e
.
response
.
status
===
403
)
{
toast
.
error
(
"
Unauthorized : You don't have the rights to do this operation
"
)
}
else
{
toast
.
error
(
'
Failed to delete monthly info
'
)
}
console
.
error
(
e
)
console
.
error
(
e
)
}
}
}
}
...
@@ -115,8 +127,14 @@ export class NewsletterService {
...
@@ -115,8 +127,14 @@ export class NewsletterService {
}
}
)
)
toast
.
success
(
'
Monthly news succesfully saved !
'
)
toast
.
success
(
'
Monthly news succesfully saved !
'
)
}
catch
(
e
)
{
}
catch
(
e
:
any
)
{
toast
.
error
(
'
Failed to create monthly news
'
)
if
(
e
.
response
.
status
===
403
)
{
toast
.
error
(
"
Unauthorized : You don't have the rights to do this operation
"
)
}
else
{
toast
.
error
(
'
Failed to save monthly news
'
)
}
console
.
error
(
e
)
console
.
error
(
e
)
}
}
}
}
...
@@ -165,8 +183,14 @@ export class NewsletterService {
...
@@ -165,8 +183,14 @@ export class NewsletterService {
}
}
)
)
toast
.
success
(
'
Monthly news succesfully deleted !
'
)
toast
.
success
(
'
Monthly news succesfully deleted !
'
)
}
catch
(
e
)
{
}
catch
(
e
:
any
)
{
toast
.
error
(
'
Failed to delete monthly news
'
)
if
(
e
.
response
.
status
===
403
)
{
toast
.
error
(
"
Unauthorized : You don't have the rights to do this operation
"
)
}
else
{
toast
.
error
(
'
Failed to delete monthly news
'
)
}
console
.
error
(
e
)
console
.
error
(
e
)
}
}
}
}
...
@@ -199,8 +223,14 @@ export class NewsletterService {
...
@@ -199,8 +223,14 @@ export class NewsletterService {
}
}
)
)
toast
.
success
(
'
Poll successfully saved !
'
)
toast
.
success
(
'
Poll successfully saved !
'
)
}
catch
(
e
)
{
}
catch
(
e
:
any
)
{
toast
.
error
(
'
Failed to create poll
'
)
if
(
e
.
response
.
status
===
403
)
{
toast
.
error
(
"
Unauthorized : You don't have the rights to do this operation
"
)
}
else
{
toast
.
error
(
'
Failed to create poll
'
)
}
console
.
error
(
e
)
console
.
error
(
e
)
}
}
}
}
...
@@ -246,8 +276,14 @@ export class NewsletterService {
...
@@ -246,8 +276,14 @@ export class NewsletterService {
}
}
)
)
toast
.
success
(
'
Poll succesfully deleted !
'
)
toast
.
success
(
'
Poll succesfully deleted !
'
)
}
catch
(
e
)
{
}
catch
(
e
:
any
)
{
toast
.
error
(
'
Failed to delete poll
'
)
if
(
e
.
response
.
status
===
403
)
{
toast
.
error
(
"
Unauthorized : You don't have the rights to do this operation
"
)
}
else
{
toast
.
error
(
'
Failed to delete poll
'
)
}
console
.
error
(
e
)
console
.
error
(
e
)
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment