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 node for creating new organization #1444

Open sudan45 opened 5 months ago

sudan45 commented 5 months ago

Problem Statement

Creating new organization features uses a Rest API.

Acceptance Criteria

Creating new organization works with a graphql mutation.

Additional Information

serializer

https://github.com/the-deep/server/blob/0c1dc335c25035ce40b6e55ad73fc4ba3deafa59/apps/organization/serializers.py#L34-L55

views

https://github.com/the-deep/server/blob/0c1dc335c25035ce40b6e55ad73fc4ba3deafa59/apps/organization/views.py#L27-L46

testcase

Not updated

Rest Framework URLs


method: POST
url: /api/v1/organizations
request payload: {
  "title": str
  "shortName":str,
  "url": str
  "organizationType": ID,
  "logo": ID
}
response: {
    "id":ID,
    "modifiedAt": datetime
    "modifiedBy": ID,
    "createdByName": str,
    "modifiedByName": str,
    "organizationTypeDisplay": Object / Organization type,
    "regionsDisplay": RegionList,
    "createdAt": datetime,
    "title": str,
    "shortName": str,
    "longName": str,
    "url": str,
    "verified": bool,
    "popularity": int,
    "createdBy": ID,
    "organizationType": ID,
    "regions": regionobject
}