delete(); return response()->json(['message'=>'Company purged'], 200); } /** * * Purge Company but save settings * * @OA\Post( * path="/api/v1/migration/purge_save_settings/{company}", * operationId="postPurgeCompanySaveSettings", * tags={"migration"}, * summary="Attempts to purge a companies child records but save the company record and its settings", * description="Attempts to purge a companies child records but save the company record and its settings", * @OA\Parameter(ref="#/components/parameters/X-Api-Secret"), * @OA\Parameter(ref="#/components/parameters/X-Api-Token"), * @OA\Parameter(ref="#/components/parameters/X-Requested-With"), * @OA\Parameter( * name="company", * in="path", * description="The Company Hashed ID", * example="D2J234DFA", * required=true, * @OA\Schema( * type="string", * format="string", * ), * ), * @OA\Response( * response=200, * description="Success", * @OA\Header(header="X-API-Version", ref="#/components/headers/X-API-Version"), * @OA\Header(header="X-RateLimit-Remaining", ref="#/components/headers/X-RateLimit-Remaining"), * @OA\Header(header="X-RateLimit-Limit", ref="#/components/headers/X-RateLimit-Limit"), * ), * @OA\Response( * response=422, * description="Validation error", * @OA\JsonContent(ref="#/components/schemas/ValidationError"), * ), * @OA\Response( * response="default", * description="Unexpected Error", * @OA\JsonContent(ref="#/components/schemas/Error"), * ), * ) */ public function purgeCompanySaveSettings(Company $company) { $company->client->delete(); $company->save(); return response()->json(['message'=>'Settings preserved'], 200); } }