Square away saving of existing files

This commit is contained in:
Dane Everitt 2019-10-26 13:16:27 -07:00
parent 0dff732883
commit 78ccdf93b6
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
5 changed files with 135 additions and 55 deletions

View file

@ -0,0 +1,18 @@
import http from '@/api/http';
export default (uuid: string, file: string, content: string): Promise<void> => {
return new Promise((resolve, reject) => {
http.post(
`/api/client/servers/${uuid}/files/write`,
content,
{
params: { file },
headers: {
'Content-Type': 'text/plain',
},
},
)
.then(() => resolve())
.catch(reject);
});
};