|
11 | 11 | use Illuminate\Support\Facades\Storage; |
12 | 12 | use League\Fractal\Manager; |
13 | 13 |
|
| 14 | +/** |
| 15 | + * @OA\Tag( |
| 16 | + * name="Organisation", |
| 17 | + * description="Operations about Organisations" |
| 18 | + * ) |
| 19 | + */ |
14 | 20 | class OrganisationController extends Controller |
15 | 21 | { |
16 | 22 | /** |
@@ -101,6 +107,77 @@ public function getById($code, Request $request) |
101 | 107 | /** |
102 | 108 | * @param $code |
103 | 109 | * @return \Symfony\Component\HttpFoundation\Response |
| 110 | + */ |
| 111 | + /** |
| 112 | + * @OA\Put( |
| 113 | + * path="/organisation/{code}", |
| 114 | + * summary="Update organisation by country code", |
| 115 | + * tags={"Organisation"}, |
| 116 | + * @OA\Parameter( |
| 117 | + * name="code", |
| 118 | + * in="path", |
| 119 | + * description="Country code of the organisation", |
| 120 | + * required=true, |
| 121 | + * @OA\Schema(type="string") |
| 122 | + * ), |
| 123 | + * @OA\RequestBody( |
| 124 | + * required=true, |
| 125 | + * @OA\JsonContent( |
| 126 | + * type="object", |
| 127 | + * @OA\Property(property="countryCode", type="string", example="USA"), |
| 128 | + * @OA\Property(property="name", type="string", example="American Red Cross"), |
| 129 | + * @OA\Property(property="url", type="string", nullable=true, example=null), |
| 130 | + * @OA\Property( |
| 131 | + * property="translations", |
| 132 | + * type="array", |
| 133 | + * @OA\Items( |
| 134 | + * type="object", |
| 135 | + * @OA\Property(property="languageCode", type="string", example="en"), |
| 136 | + * @OA\Property(property="name", type="string", example="Organization name"), |
| 137 | + * @OA\Property(property="attributionMessage", type="string", example="Attribution Message"), |
| 138 | + * @OA\Property(property="published", type="boolean", example=true), |
| 139 | + * @OA\Property( |
| 140 | + * property="contributors", |
| 141 | + * type="array", |
| 142 | + * @OA\Items( |
| 143 | + * type="object", |
| 144 | + * @OA\Property(property="name", type="string", example="Contributor name"), |
| 145 | + * @OA\Property(property="logo", type="string", example="logo.png") |
| 146 | + * ) |
| 147 | + * ) |
| 148 | + * ) |
| 149 | + * ) |
| 150 | + * ) |
| 151 | + * ), |
| 152 | + * @OA\Response( |
| 153 | + * response=200, |
| 154 | + * description="Successful response", |
| 155 | + * @OA\JsonContent( |
| 156 | + * type="object", |
| 157 | + * @OA\Property(property="data", type="object") |
| 158 | + * ) |
| 159 | + * ), |
| 160 | + * @OA\Response( |
| 161 | + * response=404, |
| 162 | + * description="Organisation not found", |
| 163 | + * @OA\JsonContent( |
| 164 | + * type="object", |
| 165 | + * @OA\Property(property="status", type="integer", example=404), |
| 166 | + * @OA\Property(property="error_message", type="string", example="Organisation does not exist"), |
| 167 | + * @OA\Property(property="errors", type="array", @OA\Items(type="string")) |
| 168 | + * ) |
| 169 | + * ), |
| 170 | + * @OA\Response( |
| 171 | + * response=500, |
| 172 | + * description="Organisation could not be updated", |
| 173 | + * @OA\JsonContent( |
| 174 | + * type="object", |
| 175 | + * @OA\Property(property="status", type="integer", example=500), |
| 176 | + * @OA\Property(property="error_message", type="string", example="Organisation could not be updated"), |
| 177 | + * @OA\Property(property="errors", type="array", @OA\Items(type="string")) |
| 178 | + * ) |
| 179 | + * ) |
| 180 | + * ) |
104 | 181 | */ |
105 | 182 | public function putById($code) |
106 | 183 | { |
|
0 commit comments