Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Khalid Ali
bookshare-frontend
Commits
1f71800c
Commit
1f71800c
authored
Sep 19, 2019
by
Khalid Ali
Browse files
Fix some tslint errors
parent
26f0e320
Pipeline
#4770
passed with stages
in 3 minutes and 16 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/views/CreateListing.vue
View file @
1f71800c
...
@@ -168,7 +168,7 @@ export default class CreateListing extends Vue {
...
@@ -168,7 +168,7 @@ export default class CreateListing extends Vue {
// Get CSRF Token
// Get CSRF Token
API
.
get
(
'
/bs/api/
'
).
then
((
response
)
=>
{
API
.
get
(
'
/bs/api/
'
).
then
((
response
)
=>
{
console
.
log
(
response
);
console
.
info
(
response
);
const
token
=
response
.
headers
[
'
x-csrf-token
'
];
const
token
=
response
.
headers
[
'
x-csrf-token
'
];
if
(
response
.
headers
[
'
x-csrf-token
'
]
!=
null
)
{
if
(
response
.
headers
[
'
x-csrf-token
'
]
!=
null
)
{
...
@@ -204,9 +204,9 @@ export default class CreateListing extends Vue {
...
@@ -204,9 +204,9 @@ export default class CreateListing extends Vue {
.
catch
(
function
(
this
:
CreateListing
,
error
)
{
.
catch
(
function
(
this
:
CreateListing
,
error
)
{
// Redirect to backend login
// Redirect to backend login
if
(
error
.
response
===
undefined
||
error
.
response
.
status
===
403
)
{
if
(
error
.
response
===
undefined
||
error
.
response
.
status
===
403
)
{
//location.replace('https://localhost:9090/bs/api/login');
//
location.replace('https://localhost:9090/bs/api/login');
}
}
console
.
log
(
error
);
console
.
error
(
error
);
});
});
}
}
...
...
src/views/LatestListing.vue
View file @
1f71800c
...
@@ -11,27 +11,22 @@ import { Component, Vue } from 'vue-property-decorator';
...
@@ -11,27 +11,22 @@ import { Component, Vue } from 'vue-property-decorator';
@
Component
@
Component
export
default
class
LatestListing
extends
Vue
{
export
default
class
LatestListing
extends
Vue
{
private
info
:
any
=
""
;
private
info
:
any
=
''
;
private
created
()
{
private
created
()
{
// Must be logged in
// Must be logged in
API
.
get
(
'
bs/api/listing/
'
)
API
.
get
(
'
bs/api/listing/
'
)
.
then
(
response
=>
(
this
.
info
=
response
))
.
then
(
(
response
)
=>
(
this
.
info
=
response
))
.
catch
((
error
)
=>
{
.
catch
((
error
)
=>
{
// Redirect to backend login
// Redirect to backend login
console
.
log
(
error
);
console
.
error
(
error
);
if
(
error
.
response
===
undefined
||
error
.
response
.
status
===
403
)
{
if
(
error
.
response
===
undefined
||
error
.
response
.
status
===
403
)
{
location
.
replace
(
'
https://localhost:9090/bs/api/login
'
);
location
.
replace
(
'
https://localhost:9090/bs/api/login
'
);
console
.
log
(
error
);
}
}
if
(
error
.
response
.
status
===
404
)
{
if
(
error
.
response
.
status
===
404
)
{
API
.
get
(
'
bs/api/listing/
'
);
API
.
get
(
'
bs/api/listing/
'
);
}
}
});
});
}
}
}
}
</
script
>
</
script
>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment