addded paginated user space endpoint
This commit is contained in:
@ -414,6 +414,7 @@ class UserSpaceViewSet(viewsets.ModelViewSet):
|
|||||||
serializer_class = UserSpaceSerializer
|
serializer_class = UserSpaceSerializer
|
||||||
permission_classes = [(CustomIsSpaceOwner | CustomIsOwnerReadOnly) & CustomTokenHasReadWriteScope]
|
permission_classes = [(CustomIsSpaceOwner | CustomIsOwnerReadOnly) & CustomTokenHasReadWriteScope]
|
||||||
http_method_names = ['get', 'patch', 'delete']
|
http_method_names = ['get', 'patch', 'delete']
|
||||||
|
pagination_class = DefaultPagination
|
||||||
|
|
||||||
def destroy(self, request, *args, **kwargs):
|
def destroy(self, request, *args, **kwargs):
|
||||||
if request.space.created_by == UserSpace.objects.get(pk=kwargs['pk']).user:
|
if request.space.created_by == UserSpace.objects.get(pk=kwargs['pk']).user:
|
||||||
|
@ -48,7 +48,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tr v-for="us in user_spaces" :key="us.id">
|
<tr v-for="us in user_spaces" :key="us.id">
|
||||||
<td>{{ us.user.username }}</td>
|
<td>{{ us.user.display_name }}</td>
|
||||||
<td>
|
<td>
|
||||||
<generic-multiselect
|
<generic-multiselect
|
||||||
class="input-group-text m-0 p-0"
|
class="input-group-text m-0 p-0"
|
||||||
@ -238,8 +238,8 @@ export default {
|
|||||||
apiFactory.retrieveSpace(window.ACTIVE_SPACE_ID).then(r => {
|
apiFactory.retrieveSpace(window.ACTIVE_SPACE_ID).then(r => {
|
||||||
this.space = r.data
|
this.space = r.data
|
||||||
})
|
})
|
||||||
apiFactory.listUserSpaces().then(r => {
|
apiFactory.listUserSpaces(1, 25).then(r => { //TODO build proper pagination
|
||||||
this.user_spaces = r.data
|
this.user_spaces = r.data.results
|
||||||
})
|
})
|
||||||
this.loadInviteLinks()
|
this.loadInviteLinks()
|
||||||
},
|
},
|
||||||
|
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user