• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

kiva / ui / 13684934896

05 Mar 2025 08:29PM UTC coverage: 46.776%. Remained the same
13684934896

push

github

web-flow
fix: correct email settings from optin modules (#5859)

1173 of 2582 branches covered (45.43%)

Branch coverage included in aggregate %.

0 of 4 new or added lines in 1 file covered. (0.0%)

1663 of 3481 relevant lines covered (47.77%)

384.18 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/composables/useOptIn.js
1
import logReadQueryError from '#src/util/logReadQueryError';
2
import { gql } from 'graphql-tag';
3

4
export default apollo => {
NEW
5
        const updateCommunicationSettings = async (lenderNews, loanUpdates, globalUnsubscribed) => {
×
6
                try {
×
NEW
7
                        await apollo.mutate({
×
8
                                mutation: gql`
9
                                        mutation updateCommunicationSettings(
10
                                                $lenderNews: Boolean
11
                                                $loanUpdates: Boolean
12
                                                $globalUnsubscribed: Boolean
13
                                        ) {
14
                                                my {
15
                                                        updateCommunicationSettings(
16
                                                                communicationSettings: {
17
                                                                        lenderNews: $lenderNews
18
                                                                        loanUpdates: $loanUpdates
19
                                                                        globalUnsubscribed: $globalUnsubscribed
20
                                                                }
21
                                                        )
22
                                                }
23
                                        }
24
                                `,
25
                                variables: {
26
                                        lenderNews,
27
                                        loanUpdates,
28
                                        globalUnsubscribed,
29
                                },
30
                        });
31
                } catch (error) {
32
                        logReadQueryError(error, 'OptInModule updateCommunicationSettings');
×
33
                }
34
        };
35

NEW
36
        const updateVisitorEmailOptIn = async (lenderNews, loanUpdates, globalUnsubscribed, visitorId) => {
×
37
                try {
×
NEW
38
                        await apollo.mutate({
×
39
                                mutation: gql`
40
                                mutation updateVisitorCommunicationSettings(
41
                                        $lenderNews: Boolean,
42
                                        $loanUpdates: Boolean,
43
                                        $globalUnsubscribed: Boolean,
44
                                        $visitorId: String!
45
                                ) {
46
                                        visitorEmailOptIn {
47
                                                updateCommunicationSettings(
48
                                                        communicationSettings: {
49
                                                                lenderNews: $lenderNews
50
                                                                loanUpdates: $loanUpdates
51
                                                                globalUnsubscribed: $globalUnsubscribed
52
                                                        },
53
                                                        visitorId: $visitorId
54
                                                )
55
                                        }
56
                                }
57
                        `,
58
                                variables: {
59
                                        lenderNews,
60
                                        loanUpdates,
61
                                        globalUnsubscribed,
62
                                        visitorId,
63
                                },
64
                        });
65
                } catch (error) {
66
                        logReadQueryError(error, 'OptInModule updateVisitorCommunicationSettings');
×
67
                }
68
        };
69

70
        return {
×
71
                updateCommunicationSettings,
72
                updateVisitorEmailOptIn,
73
        };
74
};
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc