# weforms/1.4.3/assets/spa/components/transactions/index.js

weForms – Easy Drag &amp; Drop Contact Form Builder For WordPress, version 1.4.3. 43 lines.

- Page: https://pluginprobe.com/plugins/weforms/1.4.3/code/assets/spa/components/transactions/index.js
- Raw: https://pluginprobe.com/plugins/weforms/1.4.3/raw/assets/spa/components/transactions/index.js
- Modified: 2019-11-18T04:29:52+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/weforms/1.4.3/code/assets/spa/components/transactions/index.js#L10-L20`.

```javascript
weForms.routeComponents.Transactions = {
    template: '#tmpl-wpuf-transactions',
    data: function() {
        return {
            selected: 0,
            no_transactions: false,
            forms: {},
            form_title: 'Loading...',
        };
    },

    created: function(){
        this.get_forms();
    },

    methods: {
        get_forms: function(){
            var self = this;

            wp.ajax.send( 'weforms_form_list', {
                data: {
                    _wpnonce: weForms.nonce,
                    page: self.currentPage,
                    filter: 'transactions',
                },
                success: function(response) {

                    if ( Object.keys(response.forms).length ) {
                        self.forms = response.forms;
                        self.selected = self.forms[Object.keys(self.forms)[0]].id;
                    } else {
                        self.form_title = 'No transaction found';
                        self.no_transactions = true;
                    }
                },
                error: function(error) {
                    alert(error);
                }
            });
        },
    },
};

```
