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

kiva / ui / 13190597389

07 Feb 2025 12:30AM UTC coverage: 46.427% (-0.07%) from 46.496%
13190597389

push

github

web-flow
Merge pull request #5785 from kiva/separate-opt-in-module-from-my-kiva-exp-MP-1321

feat: separate opt in module from my kiva exp mp 1321

1171 of 2596 branches covered (45.11%)

Branch coverage included in aggregate %.

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

1662 of 3506 relevant lines covered (47.4%)

381.51 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 = lenderNews => {
×
NEW
6
                try {
×
NEW
7
                        apollo.mutate({
×
8
                                mutation: gql`
9
                                        mutation updateCommunicationSettings(
10
                                                $lenderNews: Boolean
11
                                        ) {
12
                                                my {
13
                                                        updateCommunicationSettings(
14
                                                                communicationSettings: {
15
                                                                        lenderNews: $lenderNews
16
                                                                }
17
                                                        )
18
                                                }
19
                                        }
20
                                `,
21
                                variables: {
22
                                        lenderNews,
23
                                },
24
                        });
25
                } catch (error) {
NEW
26
                        logReadQueryError(error, 'OptInModule updateCommunicationSettings');
×
27
                }
28
        };
29

NEW
30
        const updateVisitorEmailOptIn = (lenderNews, visitorId) => {
×
NEW
31
                try {
×
NEW
32
                        apollo.mutate({
×
33
                                mutation: gql`
34
                                mutation updateVisitorCommunicationSettings(
35
                                        $lenderNews: Boolean,
36
                                        $visitorId: String!
37
                                ) {
38
                                        visitorEmailOptIn {
39
                                                updateCommunicationSettings(
40
                                                        communicationSettings: {
41
                                                                lenderNews: $lenderNews
42
                                                        },
43
                                                        visitorId: $visitorId
44
                                                )
45
                                        }
46
                                }
47
                        `,
48
                                variables: {
49
                                        lenderNews,
50
                                        visitorId,
51
                                },
52
                        });
53
                } catch (error) {
NEW
54
                        logReadQueryError(error, 'OptInModule updateVisitorCommunicationSettings');
×
55
                }
56
        };
57

NEW
58
        return {
×
59
                updateCommunicationSettings,
60
                updateVisitorEmailOptIn,
61
        };
62
};
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