Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

my commit #444

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions backend/channel_plugin/Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[[source]]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this file

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay boss..done

url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]

[dev-packages]

[requires]
python_version = "3.8"
9 changes: 9 additions & 0 deletions backend/channel_plugin/apps/channels/urls.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
from apps.channels import views
from apps.channels.views import (

Test, SearchMessagesAPIView, GetChannelInfo,
create_channel, GetChannelRoles, CreateThreadView,ThreadUserRoleView,
ThreadUserRoleUpdateAPIView,GetChannelList

CreateThreadView,
GetChannelInfo,
GetChannelRoles,
Expand All @@ -10,6 +15,7 @@
ThreadUserRoleView,
channelUserRoles,
create_channel,

)
from django.urls import path

Expand All @@ -29,10 +35,13 @@
CreateThreadView.as_view(),
name="create-thread",
),

path("channels/",GetChannelList.as_view(), name='channels_list'),
path(
"organizations/<organization_id>/channels/<channel_id>/thread/<thread_id>/",
views.ThreadUpdateAPIView.as_view(),
name="thread_update",
),
path("roles/<int:pk>/", channelUserRoles.as_view()),

]
21 changes: 21 additions & 0 deletions backend/channel_plugin/apps/channels/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@

from .serializers import (
ChannelMessageSerializer,
ThreadSerializer,
ChannelSerializer,
SearchMessageQuerySerializer,
ThreadSerializer,
ThreadUpdateSerializer,
ThreadUserRoleSerializer,

)
from .utils import find_item_in_data

Expand Down Expand Up @@ -188,6 +190,24 @@ def post(self, request):
)


class GetChannelList(APIView):
def get(self, request, pk=0):
channels = [
{"id": pk,
"title":"Channel title",
"description":"Channel description",
"private":['false'],
"closed":['false'],
"members": [
{"id":"user_id",
"roles":["id reference to the users role"]
}
],
},
]

return Response(channels, status=status.HTTP_200_OK)

class ThreadUpdateAPIView(APIView):
def get(self, request, organization_id, thread_id, channel_id):
thread = {
Expand All @@ -213,3 +233,4 @@ class channelUserRoles(APIView):
def delete(self, request, pk):
data = {"message": f"Role {pk} has been successfully deleted"}
return Response(data, status=status.HTTP_204_NO_CONTENT)