푸시 발송 - account -> member 로 변경
This commit is contained in:
parent
423316cab4
commit
581127b4e0
|
@ -1,8 +1,8 @@
|
|||
import Vue from 'vue';
|
||||
|
||||
async function sendPush(accountIds, title, message) {
|
||||
async function sendPush(memberIds, title, message) {
|
||||
return Vue.axios.post('/push', {
|
||||
accountIds,
|
||||
memberIds,
|
||||
title,
|
||||
message
|
||||
})
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
<v-container>
|
||||
<v-text-field
|
||||
v-model="account_id"
|
||||
v-model="member_id"
|
||||
label="회원번호(입력하지 않으면 전체회원에게 발송)"
|
||||
outlined
|
||||
required
|
||||
|
@ -53,8 +53,8 @@
|
|||
>
|
||||
<v-card>
|
||||
<v-card-title>푸시메시지 발송 확인</v-card-title>
|
||||
<v-card-text v-if="account_id.length > 0">
|
||||
발송대상(회원번호): {{ send_account_id }}
|
||||
<v-card-text v-if="member_id.length > 0">
|
||||
발송대상(회원번호): {{ send_member_id }}
|
||||
</v-card-text>
|
||||
<v-card-text v-else>
|
||||
발송대상(회원번호): 전체
|
||||
|
@ -101,8 +101,8 @@ export default {
|
|||
return {
|
||||
show_confirm: false,
|
||||
isLoading: false,
|
||||
account_id: '',
|
||||
send_account_id: [],
|
||||
member_id: '',
|
||||
send_member_id: [],
|
||||
title: '',
|
||||
message: ''
|
||||
}
|
||||
|
@ -127,12 +127,12 @@ export default {
|
|||
}
|
||||
|
||||
if (!this.isLoading) {
|
||||
if (this.account_id.length > 0) {
|
||||
this.send_account_id = Array.from(
|
||||
if (this.member_id.length > 0) {
|
||||
this.send_member_id = Array.from(
|
||||
new Set(
|
||||
this.account_id.split(",")
|
||||
.map(accountId => accountId.trim())
|
||||
.filter(accountId => Number(accountId))
|
||||
this.member_id.split(",")
|
||||
.map(memberId => memberId.trim())
|
||||
.filter(memberId => Number(memberId))
|
||||
)
|
||||
)
|
||||
}
|
||||
|
@ -150,15 +150,15 @@ export default {
|
|||
|
||||
try {
|
||||
await api.sendPush(
|
||||
this.send_account_id,
|
||||
this.send_member_id,
|
||||
this.title,
|
||||
this.message
|
||||
)
|
||||
} finally {
|
||||
this.isLoading = false
|
||||
this.show_confirm = false
|
||||
this.account_id = ''
|
||||
this.send_account_id = []
|
||||
this.member_id = ''
|
||||
this.send_member_id = []
|
||||
this.title = ''
|
||||
this.message = ''
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue