feat: added CRUD operation for issue subscriber

This commit is contained in:
NarayanBavisetti 2023-06-22 18:20:59 +05:30
parent 9fd245a53c
commit b22e062576
2 changed files with 24 additions and 6 deletions

View File

@ -534,11 +534,11 @@ class IssueLiteSerializer(BaseSerializer):
class IssueSubscriberSerializer(BaseSerializer): class IssueSubscriberSerializer(BaseSerializer):
project = serializers.PrimaryKeyRelatedField(read_only=True)
workspace = serializers.PrimaryKeyRelatedField(read_only=True)
issue = serializers.PrimaryKeyRelatedField(read_only=True)
subscriber = serializers.PrimaryKeyRelatedField(read_only=True)
class Meta: class Meta:
model = IssueSubscriber model = IssueSubscriber
fields = "__all__" fields = "__all__"
read_only_fields = [
"workspace",
"project",
"issue",
]

View File

@ -801,16 +801,34 @@ urlpatterns = [
## End IssueComments ## End IssueComments
# Issue Subscribers # Issue Subscribers
path( path(
"workspaces/<str:slug>/projects/<uuid:project_id>/issues/<uuid:issue_id>/subscribers/", "workspaces/<str:slug>/projects/<uuid:project_id>/issues/<uuid:issue_id>/issue-subscribers/",
IssueSubscriberViewSet.as_view( IssueSubscriberViewSet.as_view(
{ {
"get": "list", "get": "list",
"post": "create", "post": "create",
}
),
name="project-issue-subscriber",
),
path(
"workspaces/<str:slug>/projects/<uuid:project_id>/issues/<uuid:issue_id>/issue-subscribers/<uuid:subscriber_id>",
IssueSubscriberViewSet.as_view(
{
"delete": "destroy" "delete": "destroy"
} }
), ),
name="project-issue-subscriber", name="project-issue-subscriber",
), ),
path(
"workspaces/<str:slug>/projects/<uuid:project_id>/issues/<uuid:issue_id>/subscribe/",
IssueSubscriberViewSet.as_view(
{
"get": "subscription_status",
"post": "subscribe",
}
),
name="project-issue-subscriber",
),
## End Issue Subscribers ## End Issue Subscribers
## IssueProperty ## IssueProperty
path( path(