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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Håkon Eilertsen Røskaft
boco-frontend
Commits
607008d8
Commit
607008d8
authored
May 6, 2022
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
No related merge requests found
Changes
2
Show 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";
const
API_URL
=
process
.
env
.
VUE_APP_BASEURL
;
/**
* Service class acting as a middle layer between our components and the API
*/
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
()
{
return
await
axios
.
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;
* Service class acting as a middle layer between our components and the API
*/
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
)
{
return
await
axios
.
get
(
API_URL
+
"
communities/
"
+
communityID
+
"
/user/admin
"
,
{
...
...
@@ -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
)
{
return
await
axios
.
post
(
API_URL
+
"
communities/
"
+
communityID
+
"
/requests
"
,
...
...
@@ -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
)
{
return
await
axios
.
patch
(
API_URL
+
"
communitites/
"
+
communityID
+
"
/requests/reject
"
,
...
...
@@ -37,9 +52,9 @@ class CommunityAdminService {
/**
* Method that kicks a user from a community
* @param {
int
} communityID the community to remove the user from
* @param {
int
} userID the user to remove
* @returns
TODO
* @param {
Number
} communityID the community to remove the user from
* @param {
Number
} userID the user to remove
* @returns
the response.
*/
async
removeUserFromCommunity
(
communityID
,
userID
)
{
return
await
axios
.
patch
(
...
...
@@ -56,8 +71,8 @@ class CommunityAdminService {
/**
* Method to delete a community
* @param {
int
} communityID id of the community to delete.
* @returns
TODO
* @param {
Number
} communityID id of the community to delete.
* @returns
the response.
*/
async
deleteCommunity
(
communityID
)
{
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