addded paginated user space endpoint

This commit is contained in:
vabene1111
2023-07-11 17:01:56 +02:00
parent 6f0dccfec9
commit e9748a160a
3 changed files with 117 additions and 2035 deletions

View File

@ -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:

View File

@ -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