release v2.0.0 #4

Merged
crimsen merged 481 commits from develop into master 2024-01-18 15:15:08 +00:00
1 changed files with 6 additions and 5 deletions
Showing only changes of commit f28e597d53 - Show all commits

View File

@ -69,7 +69,7 @@ import { notEmpty } from 'src/utils/validators';
export default defineComponent({ export default defineComponent({
name: 'NewDrink', name: 'NewDrink',
emits: { close }, emits: { close: () => true },
setup(_, { emit }) { setup(_, { emit }) {
const store = usePricelistStore(); const store = usePricelistStore();
const emptyDrink: FG.Drink = { const emptyDrink: FG.Drink = {
@ -108,13 +108,14 @@ export default defineComponent({
}, },
}); });
function addDrink() { async function addDrink() {
void store.setDrink(newDrink.value); // Maybe try catch and handle error (e.g. name used...)
await store.setDrink(newDrink.value);
cancelAddDrink(); cancelAddDrink();
setTimeout(() => emit('close'), 200); emit('close');
} }
function cancelAddDrink() { function cancelAddDrink() {
setTimeout(() => (newDrink.value = emptyDrink), 200); newDrink.value = emptyDrink;
} }
const newDrink = ref<FG.Drink>(emptyDrink); const newDrink = ref<FG.Drink>(emptyDrink);