misc_pterodactyl-panel/resources/scripts/api/server/databases/rotateDatabasePassword.ts

11 lines
475 B
TypeScript
Raw Normal View History

import { rawDataToServerDatabase, ServerDatabase } from '@/api/server/databases/getServerDatabases';
2019-07-27 22:17:50 +00:00
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);
});
};