Skip to content

Commit

Permalink
feat: add code to swagger-v2
Browse files Browse the repository at this point in the history
  • Loading branch information
LimberHope committed Apr 22, 2024
1 parent b8bd082 commit 8ca2c3f
Show file tree
Hide file tree
Showing 4 changed files with 101 additions and 81 deletions.
29 changes: 0 additions & 29 deletions openapi-src/V2/definitions/RegistrationUsersCreate.yml

This file was deleted.

51 changes: 0 additions & 51 deletions openapi-src/V2/definitions/RegistrationUsersRead.yml

This file was deleted.

100 changes: 100 additions & 0 deletions resources/docs/swagger-v2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43997,6 +43997,84 @@ definitions:
properties:
email_address:
type: string
RoleUserCreate:
title: RoleUserCreate
type: object
properties:
first_name:
type: string
last_name:
type: string
email_address:
type: string
password:
type: string
job_role:
type: string
facebook:
type: string
twitter:
type: string
instagram:
type: string
linkedin:
type: string
phone_number:
type: string
whatsapp_phone:
type: string
callback_url:
type: string
RoleUserRead:
title: RoleUserRead
type: object
properties:
id:
type: integer
organisation_id:
type: integer
organisation_name:
type: string
my_organisation:
$ref: '#/definitions/V2AdminOrganisationRead'
my_monitoring_organisations:
type: array
items:
$ref: '#/definitions/V2MonitoringOrganisationRead'
first_name:
type: string
last_name:
type: string
email_address:
type: string
email_address_verified_at:
type: string
format: date-time
role:
type: string
last_logged_in_at:
type: string
format: date-time
job_role:
type: string
facebook:
type: string
twitter:
type: string
instagram:
type: string
linkedin:
type: string
avatar:
type: string
phone_number:
type: string
whatsapp_phone:
type: string
has_ppc_projects:
type: boolean
has_terrafund_projects:
type: boolean
paths:
'/v2/tree-species/{entity}/{UUID}':
get:
Expand Down Expand Up @@ -93529,6 +93607,7 @@ paths:
- V2 Sites
- V2 Nurseries
- Exports
- Roles here
parameters:
- type: string
name: ENTITY
Expand All @@ -93544,3 +93623,24 @@ paths:
description: OK
schema:
type: file
/users-register:
post:
summary: Create a user role
tags:
- Users Roles
security: []
consumes:
- application/json
produces:
- application/json
parameters:
- name: Body
in: body
required: true
schema:
$ref: '#/definitions/RoleUserCreate'
responses:
'201':
description: Created
schema:
$ref: '#/definitions/RoleUserRead'
2 changes: 1 addition & 1 deletion routes/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
Route::get('/auth/refresh', [AuthController::class, 'refreshAction']);

Route::post('/users', [UsersController::class, 'createAction']);
Route::post('/register-user', [UsersRoleController::class, 'createAction']);
Route::post('/users-register', [UsersRoleController::class, 'createAction']);
});

Route::patch('/auth/verify', [AuthController::class, 'verifyAction']);
Expand Down

0 comments on commit 8ca2c3f

Please sign in to comment.