Support saving existing files
This commit is contained in:
parent
a8f523e2aa
commit
bfdc1f766b
6 changed files with 95 additions and 2 deletions
|
@ -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);
|
||||
});
|
||||
}
|
Reference in a new issue