misc_pterodactyl-panel/resources/scripts/api/server/rotateDatabasePassword.ts
2019-07-27 15:17:50 -07:00

10 lines
465 B
TypeScript

import { rawDataToServerDatabase, ServerDatabase } from '@/api/server/getServerDatabases';
import http from '@/api/http';
export default (uuid: string, database: string): Promise<ServerDatabase> => {
return new Promise((resolve, reject) => {
http.post(`/api/client/servers/${uuid}/databases/${database}/rotate-password`)
.then((response) => resolve(rawDataToServerDatabase(response.data.attributes)))
.catch(reject);
});
};