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
607008d8
Commit
607008d8
authored
3 years ago
by
Oda Alida Fønstelien Hjelljord
Browse files
Options
Downloads
Plain Diff
Merge branch 'doc' into 'main'
Doc See merge request
!168
parents
94f5fc96
c04ac1dd
No related branches found
No related tags found
1 merge request
!168
Doc
Pipeline
#182826
failed
3 years ago
Stage: test
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/services/chat.service.js
+7
-0
7 additions, 0 deletions
src/services/chat.service.js
src/services/community-admin.service.js
+22
-7
22 additions, 7 deletions
src/services/community-admin.service.js
with
29 additions
and
7 deletions
src/services/chat.service.js
+
7
−
0
View file @
607008d8
...
@@ -3,7 +3,14 @@ import { tokenHeader } from "@/utils/token-utils";
...
@@ -3,7 +3,14 @@ import { tokenHeader } from "@/utils/token-utils";
const
API_URL
=
process
.
env
.
VUE_APP_BASEURL
;
const
API_URL
=
process
.
env
.
VUE_APP_BASEURL
;
/**
* Service class acting as a middle layer between our components and the API
*/
class
ChatService
{
class
ChatService
{
/**
* Service method to get the logged in user's conversations.
* @returns an array of objects containing two objects containing the last message and the recipient.
*/
async
getConversations
()
{
async
getConversations
()
{
return
await
axios
return
await
axios
.
get
(
API_URL
+
"
chats/users
"
,
{
.
get
(
API_URL
+
"
chats/users
"
,
{
...
...
This diff is collapsed.
Click to expand it.
src/services/community-admin.service.js
+
22
−
7
View file @
607008d8
...
@@ -7,6 +7,11 @@ const API_URL = process.env.VUE_APP_BASEURL;
...
@@ -7,6 +7,11 @@ const API_URL = process.env.VUE_APP_BASEURL;
* Service class acting as a middle layer between our components and the API
* Service class acting as a middle layer between our components and the API
*/
*/
class
CommunityAdminService
{
class
CommunityAdminService
{
/**
* Checks if the current user is an admin in the community that is being accessed.
* @param {Number} communityID ID of the community to the if the user is an admin in.
* @returns a boolean.
*/
async
isUserAdmin
(
communityID
)
{
async
isUserAdmin
(
communityID
)
{
return
await
axios
return
await
axios
.
get
(
API_URL
+
"
communities/
"
+
communityID
+
"
/user/admin
"
,
{
.
get
(
API_URL
+
"
communities/
"
+
communityID
+
"
/user/admin
"
,
{
...
@@ -17,7 +22,12 @@ class CommunityAdminService {
...
@@ -17,7 +22,12 @@ class CommunityAdminService {
});
});
}
}
//TODO
/**
* Accepts a member request.
* @param {Number} communityID the community to accept the request into.
* @param {Number} userID the user id of the user being accepted into the community.
* @returns the response.
*/
async
acceptUserIntoCommunity
(
communityID
,
userID
)
{
async
acceptUserIntoCommunity
(
communityID
,
userID
)
{
return
await
axios
.
post
(
return
await
axios
.
post
(
API_URL
+
"
communities/
"
+
communityID
+
"
/requests
"
,
API_URL
+
"
communities/
"
+
communityID
+
"
/requests
"
,
...
@@ -26,7 +36,12 @@ class CommunityAdminService {
...
@@ -26,7 +36,12 @@ class CommunityAdminService {
);
);
}
}
//TODO
/**
* Reject a user's request to join a community.
* @param {Number} communityID id of the community to reject the request from.
* @param {Number} userID id of the user being rejected.
* @returns the response.
*/
async
rejectUserFromCommunity
(
communityID
,
userID
)
{
async
rejectUserFromCommunity
(
communityID
,
userID
)
{
return
await
axios
.
patch
(
return
await
axios
.
patch
(
API_URL
+
"
communitites/
"
+
communityID
+
"
/requests/reject
"
,
API_URL
+
"
communitites/
"
+
communityID
+
"
/requests/reject
"
,
...
@@ -37,9 +52,9 @@ class CommunityAdminService {
...
@@ -37,9 +52,9 @@ class CommunityAdminService {
/**
/**
* Method that kicks a user from a community
* Method that kicks a user from a community
* @param {
int
} communityID the community to remove the user from
* @param {
Number
} communityID the community to remove the user from
* @param {
int
} userID the user to remove
* @param {
Number
} userID the user to remove
* @returns
TODO
* @returns
the response.
*/
*/
async
removeUserFromCommunity
(
communityID
,
userID
)
{
async
removeUserFromCommunity
(
communityID
,
userID
)
{
return
await
axios
.
patch
(
return
await
axios
.
patch
(
...
@@ -56,8 +71,8 @@ class CommunityAdminService {
...
@@ -56,8 +71,8 @@ class CommunityAdminService {
/**
/**
* Method to delete a community
* Method to delete a community
* @param {
int
} communityID id of the community to delete.
* @param {
Number
} communityID id of the community to delete.
* @returns
TODO
* @returns
the response.
*/
*/
async
deleteCommunity
(
communityID
)
{
async
deleteCommunity
(
communityID
)
{
return
await
axios
.
delete
(
return
await
axios
.
delete
(
...
...
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