diff --git a/packages/playground/src/dashboard/components/create_farm.vue b/packages/playground/src/dashboard/components/create_farm.vue index 938e6d253b..3c0b39c51f 100644 --- a/packages/playground/src/dashboard/components/create_farm.vue +++ b/packages/playground/src/dashboard/components/create_farm.vue @@ -21,10 +21,10 @@ - + @@ -65,26 +59,20 @@ import { createCustomToast, ToastType } from "../../utils/custom_toast"; export default { name: "CreateFarm", - props: { - name: { - type: String, - required: true, - }, - }, - - setup(props, context) { + setup() { const showDialogue = ref(false); const isCreating = ref(false); const gridStore = useGrid(); const valid = ref(false); + const farmName = ref(""); async function createFarm() { try { isCreating.value = true; - await gridStore.grid.farms.create({ name: props.name }); + await gridStore.grid.farms.create({ name: farmName.value }); createCustomToast("Farm created successfully.", ToastType.success); showDialogue.value = false; - context.emit("farm-created"); + farmName.value = ""; notifyDelaying(); } catch (error) { console.log(error); @@ -109,6 +97,7 @@ export default { showDialogue, isCreating, valid, + farmName, createFarm, validateFarmName, }; diff --git a/packages/playground/src/dashboard/farms_view.vue b/packages/playground/src/dashboard/farms_view.vue index 08108e2440..98112c10c8 100644 --- a/packages/playground/src/dashboard/farms_view.vue +++ b/packages/playground/src/dashboard/farms_view.vue @@ -5,7 +5,7 @@ Farms - + @@ -17,7 +17,6 @@ import { ref } from "vue"; import CreateFarm from "./components/create_farm.vue"; import UserFarms from "./components/user_farms.vue"; import UserNodes from "./components/user_nodes.vue"; - export default { name: "DashboardFarms", components: { @@ -26,11 +25,9 @@ export default { CreateFarm, }, setup() { - const name = ref(""); const farmsReload = ref(false); return { - name, farmsReload, }; },