the-deep / server

Server for DEEP
https://app.thedeep.io/
GNU Affero General Public License v3.0
9 stars 3 forks source link

Implement Graphql mutation for region #1447

Open sudan45 opened 5 months ago

sudan45 commented 5 months ago

Problem Statement

The ' create region' features uses a Rest API.

Acceptance Criteria

The 'Region' feature works with a graphql mutation.

Additional Information

serializer

https://github.com/the-deep/server/blob/0c1dc335c25035ce40b6e55ad73fc4ba3deafa59/apps/geo/serializers.py#L35-L81

views

https://github.com/the-deep/server/blob/0c1dc335c25035ce40b6e55ad73fc4ba3deafa59/apps/geo/views.py#L40-L50

Rest Framework urls 
method: POST
url: api/v1/regions/
request payload: {"title":"Nepal Region","code":"NPL","project":"3","public":false,"isPublished":false}
response: {
    "count": int,
    "next": null,
    "previous": null,
    "results":{
        "id": ID,
        "modifiedAt": Datetime,
        "modifiedBy": ID,
        "createdByName": str,
        "modifiedByName": str,
        "versionId": ID,
        "adminLevels": [],
        "isPublished": Boolean,
        "createdAt": Datetime,
        "code": str,
        "title": Str,
        "public": boolean,
        "cacheIndex": int,
        "createdBy": Id
}
}
sudan45 commented 5 months ago

PR: #1449

thenav56 commented 4 months ago

Hey @sudan45 Can you check if we have already created ticket for publishing geo regions?

Update: Found it