mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-14 04:13:46 +02:00
Square away saving of existing files
This commit is contained in:
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 New Issue
Block a user