Skip to main content
Glama
FormRecipient.js2.04 kB
export default { name: 'FormRecipient', props: { type: { type: String, required: true }, phone: { type: String, required: true }, showStatus: { type: Boolean, default: false } }, data() { return { recipientTypes: [] }; }, computed: { phone_id() { return this.phone + this.type; }, showPhoneInput() { return this.type !== window.TYPESTATUS; }, filteredRecipientTypes() { return this.recipientTypes.filter(type => { if (!this.showStatus && type.value === window.TYPESTATUS) { return false; } return true; }); } }, mounted() { this.recipientTypes = [ { value: window.TYPEUSER, text: 'Private Message' }, { value: window.TYPEGROUP, text: 'Group Message' }, { value: window.TYPENEWSLETTER, text: 'Newsletter' }, { value: window.TYPESTATUS, text: 'Status' } ]; }, methods: { updateType(event) { this.$emit('update:type', event.target.value); if (event.target.value === window.TYPESTATUS) { this.$emit('update:phone', ''); } }, updatePhone(event) { this.$emit('update:phone', event.target.value); } }, template: ` <div class="field"> <label>Type</label> <select name="type" @change="updateType" class="ui dropdown"> <option v-for="type in filteredRecipientTypes" :value="type.value">{{ type.text }}</option> </select> </div> <div v-if="showPhoneInput" class="field"> <label>Phone / Group ID</label> <input :value="phone" aria-label="wa identifier" @input="updatePhone"> <input :value="phone_id" disabled aria-label="whatsapp_id"> </div> ` }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/samihalawa/whatsapp-go-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server