Update logic that handles creation of folders for a server
This commit is contained in:
parent
ec87330a81
commit
95d19bf09e
13 changed files with 116 additions and 9 deletions
|
@ -66,4 +66,22 @@ class FileRepository extends BaseWingsRepository implements FileRepositoryInterf
|
|||
|
||||
return json_decode($response->getBody(), true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new directory for the server in the given $path.
|
||||
*
|
||||
* @param string $name
|
||||
* @param string $path
|
||||
* @return \Psr\Http\Message\ResponseInterface
|
||||
*/
|
||||
public function createDirectory(string $name, string $path): ResponseInterface
|
||||
{
|
||||
return $this->getHttpClient()->post(
|
||||
sprintf('/api/servers/%s/files/create-directory', $this->getServer()->uuid),
|
||||
[
|
||||
'name' => $name,
|
||||
'directory' => $path,
|
||||
]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue