Skip to content

Commit 9dc5979

Browse files
committed
done with booking part
1 parent d9559d0 commit 9dc5979

File tree

1 file changed

+27
-28
lines changed

1 file changed

+27
-28
lines changed

src/content/execute-booking-mutation.md

Lines changed: 27 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ framework: vue
1111

1212
In this part we will finilize the mutation.
1313

14-
So we will use the Apollo Mutation component to execute the mutation. Make sure your file looks like this:
14+
So we will use the Apollo Mutation component to execute the mutation. Go back into your `BookingIndex.vue` and make sure it looks like this:
1515

16-
```
16+
```vue
1717
<template>
1818
<div>
1919
<!-- mutation --->
@@ -178,8 +178,8 @@ So we will use the Apollo Mutation component to execute the mutation. Make sure
178178
<div class="flex flex-row mt-20">
179179
<RedBlockButton
180180
@click="
181-
pay();
182-
mutate();
181+
pay()
182+
mutate()
183183
"
184184
text="Pay"
185185
class="mr-5"
@@ -223,15 +223,15 @@ So we will use the Apollo Mutation component to execute the mutation. Make sure
223223
</template>
224224
225225
<script>
226-
import HeadingOne from "../../components/typography/HeadingOne";
227-
import BodyOne from "../../components/typography/BodyOne";
228-
import DateInput from "../../components/inputs/DateInput";
229-
import Input from "../../components/inputs/Input";
230-
import RedBlockButton from "../../components/buttons/RedBlockButton";
231-
import RedOutlineButton from "../../components/buttons/RedOutlineButton";
232-
import RemoveButton from "../../components/buttons/RemoveButton";
233-
import BlueBlockButton from "../../components/buttons/BlueBlockButton";
234-
import { Card, createToken } from "vue-stripe-elements-plus";
226+
import HeadingOne from "../../components/typography/HeadingOne"
227+
import BodyOne from "../../components/typography/BodyOne"
228+
import DateInput from "../../components/inputs/DateInput"
229+
import Input from "../../components/inputs/Input"
230+
import RedBlockButton from "../../components/buttons/RedBlockButton"
231+
import RedOutlineButton from "../../components/buttons/RedOutlineButton"
232+
import RemoveButton from "../../components/buttons/RemoveButton"
233+
import BlueBlockButton from "../../components/buttons/BlueBlockButton"
234+
import { Card, createToken } from "vue-stripe-elements-plus"
235235
236236
export default {
237237
name: "Index",
@@ -253,41 +253,41 @@ export default {
253253
number: "",
254254
date: "",
255255
customers: [],
256-
};
256+
}
257257
},
258258
methods: {
259259
onDone() {
260-
this.activeKey = "4";
260+
this.activeKey = "4"
261261
},
262262
next(k) {
263-
this.activeKey = k.toString();
263+
this.activeKey = k.toString()
264264
},
265265
addCustomer() {
266266
// const o = [...this.customers];
267267
this.customers.push({
268268
name: null,
269269
Surname: null,
270-
});
270+
})
271271
272272
// this.customers.push({ o });
273273
// console.log(this.customers);
274274
//Failed to persist entry: TypeError: Cannot read property 'expires_at' of null
275275
},
276276
277277
removeCustomer(i) {
278-
this.customers.splice(i, 1);
278+
this.customers.splice(i, 1)
279279
},
280280
submitForm() {
281-
console.log(this.date);
281+
console.log(this.date)
282282
alert(
283283
`${this.customers[0].customerName}, ${this.email}, ${this.number}, ${this.date}`
284-
);
284+
)
285285
},
286286
pay() {
287-
createToken().then((data) => console.log(data.token));
287+
createToken().then(data => console.log(data.token))
288288
},
289289
},
290-
};
290+
}
291291
</script>
292292
<style>
293293
.ant-tabs-bar.ant-tabs-top-bar {
@@ -305,15 +305,14 @@ export default {
305305
border-color: green;
306306
}
307307
</style>
308-
309308
```
310309

311-
♻️ We pase in the schema document and the variables necessasry for the mutation. As well as execute an OnDone function which will allow the user to go to the next tab post mutation.
310+
♻️ We pass in the schema document and the variables necessasry for the mutation. As well as execute an `OnDone` function which will allow the user to go to the next tab post mutation.
312311

313-
♻️ We have a slot that as the variables that are similar to the query ones
312+
♻️ We have a slot that as the variables that are similar to the query ones.
314313

315-
♻️ In the third tab we have error states and loading states
314+
♻️ In the third tab we have error states and loading states.
316315

317-
♻️ In the red button the pay and mutate functions will hit stripe and execute the mutation
316+
♻️ In the red button the pay and mutate functions will hit stripe and execute the mutation.
318317

319-
Thats it! You have a working GraphQL FULLSTACK APP
318+
Thats it! You have a working GraphQL FULLSTACK APP. You should be able to make bookings for different listings now.

0 commit comments

Comments
 (0)