misc_pterodactyl-panel/resources/scripts/api/server/databases/rotateDatabasePassword.ts
2022-11-25 13:25:03 -07:00

10 lines
473 B
TypeScript

import { rawDataToServerDatabase, ServerDatabase } from '@/api/server/databases/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);
});
};