This repository has been archived on 2025-05-09. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
Astral-nook/resources/scripts/api/server/files/saveFileContents.ts
2019-10-26 13:16:27 -07:00

18 lines
497 B
TypeScript

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);
});
};