@@ -9,4 +9,11 @@ type SQLExecPayload = {
sql: string;
username: string;
}
+
+export const getDatabaseInstances = (projectId: number) => axios.get(`${SQL_PREFIX}/instances`, {
+ params: {
+ projectId,
+ },
+});
export const SQLExec = (SqlExecPayload: SQLExecPayload) => axios.post(`${SQL_PREFIX}/exec`, SqlExecPayload);
@@ -53,7 +53,7 @@
</template>
<script>
-import { SQLExecAPI, PipelineAPI } from '@/api';
+import { SQLExecAPI } from '@/api';
export default {
name: 'Database',
@@ -75,7 +75,7 @@ export default {
};
},
async mounted() {
- this.dbs = await PipelineAPI.getDeploymentsByProjectId(this.$store.state.workspace.currentProjectId);
+ this.dbs = await SQLExecAPI.getDatabaseInstances(this.$store.state.workspace.currentProjectId);
computed: {
activeRecord() {