Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
coopwire-hypothesis
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
孙灵跃 Leon Sun
coopwire-hypothesis
Commits
487578c0
Commit
487578c0
authored
Apr 01, 2019
by
Hannah Stepanek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add api.group.read to get a group by id
parent
b93d503c
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
0 deletions
+14
-0
api.js
src/sidebar/services/api.js
+1
-0
api-index.json
src/sidebar/services/test/api-index.json
+5
-0
api-test.js
src/sidebar/services/test/api-test.js
+8
-0
No files found.
src/sidebar/services/api.js
View file @
487578c0
...
@@ -232,6 +232,7 @@ function api(apiRoutes, auth, store) {
...
@@ -232,6 +232,7 @@ function api(apiRoutes, auth, store) {
member
:
{
member
:
{
delete
:
apiCall
(
'group.member.delete'
),
delete
:
apiCall
(
'group.member.delete'
),
},
},
read
:
apiCall
(
'group.read'
),
},
},
groups
:
{
groups
:
{
list
:
apiCall
(
'groups.read'
),
list
:
apiCall
(
'groups.read'
),
...
...
src/sidebar/services/test/api-index.json
View file @
487578c0
...
@@ -29,6 +29,11 @@
...
@@ -29,6 +29,11 @@
"method"
:
"DELETE"
,
"method"
:
"DELETE"
,
"desc"
:
"Remove the current user from a group."
"desc"
:
"Remove the current user from a group."
}
}
},
"read"
:
{
"url"
:
"https://example.com/api/groups/:id"
,
"method"
:
"GET"
,
"desc"
:
"Fetch a group."
}
}
},
},
"links"
:
{
"links"
:
{
...
...
src/sidebar/services/test/api-test.js
View file @
487578c0
...
@@ -124,6 +124,14 @@ describe('sidebar.services.api', function() {
...
@@ -124,6 +124,14 @@ describe('sidebar.services.api', function() {
return
api
.
group
.
member
.
delete
({
pubid
:
'an-id'
,
userid
:
'me'
});
return
api
.
group
.
member
.
delete
({
pubid
:
'an-id'
,
userid
:
'me'
});
});
});
it
(
'gets a group by provided group id'
,
()
=>
{
const
group
=
{
id
:
'group-id'
,
name
:
'Group'
};
expectCall
(
'get'
,
'groups/group-id'
,
200
,
group
);
return
api
.
group
.
read
({
id
:
'group-id'
}).
then
(
group_
=>
{
assert
.
deepEqual
(
group_
,
group
);
});
});
it
(
'removes internal properties before sending data to the server'
,
()
=>
{
it
(
'removes internal properties before sending data to the server'
,
()
=>
{
const
annotation
=
{
const
annotation
=
{
$highlight
:
true
,
$highlight
:
true
,
...
...
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