Square away saving of existing files
This commit is contained in:
parent
0dff732883
commit
78ccdf93b6
5 changed files with 135 additions and 55 deletions
18
resources/scripts/api/server/files/saveFileContents.ts
Normal file
18
resources/scripts/api/server/files/saveFileContents.ts
Normal 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);
|
||||
});
|
||||
};
|
Reference in a new issue