Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
boco-frontend
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
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
idatt2106_2022_02
boco-frontend
Commits
31d43396
Commit
31d43396
authored
2 years ago
by
Zara Mudassar
Browse files
Options
Downloads
Patches
Plain Diff
Delete apiutil.js
parent
27652267
No related branches found
Branches containing commit
No related tags found
1 merge request
!19
Item card
Pipeline
#176216
passed
2 years ago
Stage: build
Stage: test
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/utils/apiutil.js
+0
-73
0 additions, 73 deletions
src/utils/apiutil.js
with
0 additions
and
73 deletions
src/utils/apiutil.js
deleted
100644 → 0
+
0
−
73
View file @
27652267
import
axios
from
"
axios
"
;
import
{
tokenHeader
}
from
"
./token-utils
"
;
const
API_URL
=
process
.
env
.
VUE_APP_BASEURL
;
export
function
doLogin
(
loginRequest
)
{
const
auth
=
{
isLoggedIn
:
false
,
token
:
""
};
return
axios
.
post
(
API_URL
+
"
login/authentication
"
,
loginRequest
)
.
then
((
response
)
=>
{
auth
.
isLoggedIn
=
true
;
auth
.
token
=
response
.
data
;
return
auth
;
})
.
catch
((
error
)
=>
{
console
.
log
(
error
.
response
);
return
auth
;
});
}
export
function
registerUser
(
registerInfo
)
{
return
axios
.
post
(
API_URL
+
"
register
"
,
{
email
:
registerInfo
.
email
,
firstName
:
registerInfo
.
firstName
,
lastname
:
registerInfo
.
lastname
,
password
:
registerInfo
.
password
,
address
:
registerInfo
.
address
,
})
.
then
((
response
)
=>
{
return
response
;
})
.
catch
((
err
)
=>
console
.
log
(
err
));
}
export
async
function
getUser
(
userid
)
{
return
axios
.
get
(
API_URL
+
"
users/
"
+
userid
+
"
/profile
"
,
{
headers
:
tokenHeader
(),
})
.
then
((
response
)
=>
{
return
response
.
data
;
})
.
catch
((
error
)
=>
{
console
.
error
(
error
);
});
}
export
function
getRenterRating
(
userid
)
{
return
axios
.
get
(
API_URL
+
"
users/
"
+
userid
+
""
,
{
headers
:
tokenHeader
(),
})
.
then
((
response
)
=>
{
return
response
.
data
;
})
.
catch
((
error
)
=>
{
console
.
error
(
error
);
});
}
export
function
getOwnerRating
(
userid
)
{
return
axios
.
get
(
API_URL
+
"
users/
"
+
userid
+
""
,
{
headers
:
tokenHeader
(),
})
.
then
((
response
)
=>
{
return
response
.
data
;
})
.
catch
((
error
)
=>
{
console
.
error
(
error
);
});
}
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