Support saving existing files

This commit is contained in:
Dane Everitt 2019-05-27 15:30:49 -07:00
parent a8f523e2aa
commit bfdc1f766b
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
6 changed files with 95 additions and 2 deletions

View file

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