modified not url
This commit is contained in:
parent
f9ad47ef54
commit
3dd901a81f
@ -16,11 +16,9 @@ const schema = z.object({
|
||||
note: z.string().min(1, { message: "Note is required" }),
|
||||
});
|
||||
|
||||
const NotesDirectory = ( {isLoading, contactProfile, setProfileContact} ) =>
|
||||
{
|
||||
const [ IsActive, setIsActive ] = useState( true )
|
||||
const {contactNotes} = useContactNotes(contactProfile?.id,!IsActive)
|
||||
|
||||
const NotesDirectory = ({ isLoading, contactProfile, setProfileContact }) => {
|
||||
const [IsActive, setIsActive] = useState(true);
|
||||
const { contactNotes } = useContactNotes(contactProfile?.id, !IsActive);
|
||||
|
||||
const [NotesData, setNotesData] = useState();
|
||||
const [IsSubmitting, setIsSubmitting] = useState(false);
|
||||
@ -73,7 +71,7 @@ const NotesDirectory = ( {isLoading, contactProfile, setProfileContact} ) =>
|
||||
setIsSubmitting(false);
|
||||
showToast("Note added successfully!", "success");
|
||||
setAddNote(false);
|
||||
setIsActive(true)
|
||||
setIsActive(true);
|
||||
} catch (error) {
|
||||
setIsSubmitting(false);
|
||||
const msg =
|
||||
@ -93,9 +91,13 @@ const NotesDirectory = ( {isLoading, contactProfile, setProfileContact} ) =>
|
||||
<div className="d-flex align-items-center justify-content-between">
|
||||
<p className="fw-semibold m-0">Notes :</p>
|
||||
<div className="m-0 d-flex aligin-items-center">
|
||||
|
||||
<label className="switch switch-primary">
|
||||
<input type="checkbox" className="switch-input" onChange={() => setIsActive( !IsActive )} value={IsActive} />
|
||||
<input
|
||||
type="checkbox"
|
||||
className="switch-input"
|
||||
onChange={() => setIsActive(!IsActive)}
|
||||
value={IsActive}
|
||||
/>
|
||||
<span className="switch-toggle-slider">
|
||||
<span className="switch-on">
|
||||
{/* <i class="icon-base bx bx-check"></i> */}
|
||||
@ -152,10 +154,19 @@ const NotesDirectory = ( {isLoading, contactProfile, setProfileContact} ) =>
|
||||
key={noteItem.id}
|
||||
/>
|
||||
))}
|
||||
{IsActive && ( <p>{!isLoading && contactProfile?.notes.length == 0 && !addNote && ( <p className="text-center">No Notes Found</p> )}</p> )}
|
||||
{IsActive && (
|
||||
<p>
|
||||
{!isLoading && contactProfile?.notes.length == 0 && !addNote && (
|
||||
<p className="text-center">No Notes Found</p>
|
||||
)}
|
||||
</p>
|
||||
)}
|
||||
{!IsActive && (
|
||||
<p>{!isLoading && contactNotes.length == 0 && !addNote && (<p className="text-center">No Notes Found</p>) }</p>
|
||||
|
||||
<p>
|
||||
{!isLoading && contactNotes.length == 0 && !addNote && (
|
||||
<p className="text-center">No Notes Found</p>
|
||||
)}
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
@ -17,7 +17,7 @@ export const DirectoryRepository = {
|
||||
GetContactProfile: ( id ) => api.get( `/api/directory/profile/${ id }` ),
|
||||
|
||||
CreateNote: ( data ) => api.post( '/api/directory/note', data ),
|
||||
GetNote: ( id,isActive ) => api.get( `/api/directory/note/${ id }?active=${isActive}` ),
|
||||
GetNote: ( id,isActive ) => api.get( `/api/directory/notes/${ id }?active=${isActive}` ),
|
||||
UpdateNote: ( id, data ) => api.put( `/api/directory/note/${ id }`, data ),
|
||||
DeleteNote:(id)=> api.delete(`/api/directory/note/${ id }`)
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user