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

atlp-rwanda / champs-ec-fe / 13ba735d-90f9-49d3-9acb-f5a6c957f324

18 Jun 2024 10:20PM UTC coverage: 58.852% (-28.3%) from 87.175%
13ba735d-90f9-49d3-9acb-f5a6c957f324

Pull #13

circleci

k3lly003
Merge pull request #26 from atlp-rwanda/ft-disable-users-#187300202

Ft disable users #187300202
Pull Request #13: feat(ProductView): ProductView (all/one) according to there user's role #187300196

70 of 95 branches covered (73.68%)

Branch coverage included in aggregate %.

84 of 626 new or added lines in 24 files covered. (13.42%)

219 existing lines in 7 files now uncovered.

1366 of 2345 relevant lines covered (58.25%)

2.27 hits per line

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

0.0
/src/hooks/updatepassword.ts
UNCOV
1
import React, { useState } from 'react';
×
UNCOV
2
import axios from 'axios';
×
UNCOV
3
import { useRouter } from 'next/navigation';
×
UNCOV
4
import { useAppDispatch, useAppSelector } from '@/redux/store';
×
UNCOV
5
import { RootState } from '@/redux/store';
×
UNCOV
6
import {
×
UNCOV
7
  PasswordData,
×
UNCOV
8
  updatePassword,
×
UNCOV
9
} from '@/redux/slices/UpdatePasswordSlice';
×
UNCOV
10
import { clearError } from '@/redux/slices/UpdatePasswordSlice';
×
UNCOV
11

×
UNCOV
12
function UpdatePassword() {
×
UNCOV
13
  const router = useRouter();
×
UNCOV
14
  const { loading, error } = useAppSelector(
×
UNCOV
15
    (state: RootState) => state.updatePassword,
×
UNCOV
16
  );
×
UNCOV
17
  const [success, setSuccess] = useState(false);
×
UNCOV
18

×
UNCOV
19
  const dispatch = useAppDispatch();
×
UNCOV
20

×
UNCOV
21
  const submit = async (FormData: PasswordData) => {
×
22
    const result = await dispatch(updatePassword(FormData));
×
23
    const resultStatus = await result.payload?.status;
×
24
    if (resultStatus === 200) {
×
25
      setSuccess(true);
×
26
    }
×
27
  };
×
UNCOV
28

×
UNCOV
29
  const handlemoduleButton = () => {
×
30
    window.location.reload();
×
31
    setSuccess(false);
×
32
  };
×
UNCOV
33

×
UNCOV
34
  const ClearDispatch = () => {
×
35
    dispatch(clearError());
×
36
  };
×
UNCOV
37
  return {
×
UNCOV
38
    submit,
×
UNCOV
39
    error,
×
UNCOV
40
    FormData,
×
UNCOV
41
    success,
×
UNCOV
42
    handlemoduleButton,
×
UNCOV
43
    loading,
×
UNCOV
44
    ClearDispatch,
×
UNCOV
45
  };
×
UNCOV
46
}
×
UNCOV
47

×
UNCOV
48
export default UpdatePassword;
×
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

© 2025 Coveralls, Inc