Skip to content

Commit

Permalink
feat: submit address
Browse files Browse the repository at this point in the history
  • Loading branch information
nanami69 committed Apr 24, 2023
1 parent d033e17 commit c5ca27c
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 7 deletions.
41 changes: 36 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Expand Up @@ -13,6 +13,7 @@
"test": "jest"
},
"dependencies": {
"axios": "^1.3.6",
"core-js": "^3.25.3",
"leaflet": "^1.9.3",
"nuxt": "^2.15.8",
Expand Down
17 changes: 15 additions & 2 deletions pages/form.vue
Expand Up @@ -26,6 +26,7 @@
</template>

<script>
import axios from 'axios';
export default {
data() {
return {
Expand All @@ -45,8 +46,20 @@ export default {
},
methods: {
submitForm() {
// フォームの送信処理
// axiosなどを使ってバックエンドにフォームの内容を送信する
const instance = axios.create({
baseURL: 'http://localhost:8080'
});
// バックエンドにフォームの内容を送信する
instance.post('/register-cinema', {
address: this.address
})
.then((response) => {
console.log(response.data.message)
// マップにピンを立てる処理を書く
})
.catch((error) => {
console.log(error);
});
console.log('submit form', this.name, this.address, this.photo, this.comment);
// 送信後にフォームを初期化する
this.name = '';
Expand Down

0 comments on commit c5ca27c

Please sign in to comment.