Skip to content

Commit 890e56a

Browse files
authored
Merge pull request #161 from RyoichiNakai/develop
本番反映 リリース v1.0.2
2 parents d3679bc + 019cc8c commit 890e56a

File tree

2 files changed

+8
-12
lines changed

2 files changed

+8
-12
lines changed

functions/index.js

+6-10
Original file line numberDiff line numberDiff line change
@@ -195,16 +195,12 @@ exports.sendLoginDataBatch = functions.https.onCall(async (data, context) => {
195195
})
196196

197197
// メール送信の実行
198-
sgMail
199-
.send(messages)
200-
.then(() => {
201-
// eslint-disable-next-line
202-
console.log('Email sent')
203-
})
204-
.catch((err) => {
205-
// eslint-disable-next-line
206-
console.log(err)
207-
})
198+
try {
199+
await sgMail.send(messages)
200+
} catch (err) {
201+
// eslint-disable-next-line
202+
console.log(err)
203+
}
208204
})
209205

210206
// Excelから認証情報を追加し、DBにユーザ情報を保存

store/users.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { collection, doc, getDoc, getDocs, updateDoc, onSnapshot, query, where } from 'firebase/firestore'
1+
import { collection, doc, getDoc, getDocs, updateDoc, onSnapshot, query, where, orderBy } from 'firebase/firestore'
22
import { db } from '~/plugins/firebase'
33

44
const usersRef = collection(db, 'users')
@@ -63,7 +63,7 @@ export const actions = {
6363
},
6464

6565
getUsersByYear({ commit }, { year }) {
66-
const yearQuery = query(usersRef, where('year', '==', year), where('isActive', '==', true))
66+
const yearQuery = query(usersRef, where('year', '==', year), where('isActive', '==', true), orderBy('id'))
6767
return new Promise((resolve) => {
6868
getDocs(yearQuery).then((users) => {
6969
commit('setUsersByYear', { users })

0 commit comments

Comments
 (0)