mirror of
https://github.com/IgnatZakalinsky/home-works.git
synced 2025-12-18 04:39:24 +00:00
final ref hw2 / fix logic
This commit is contained in:
@@ -22,12 +22,13 @@ const defaultAffairs: any = [ // need to fix any
|
|||||||
|
|
||||||
// pure helper functions
|
// pure helper functions
|
||||||
export const filterAffairs = (affairs: any, filter: any): any => { // need to fix any
|
export const filterAffairs = (affairs: any, filter: any): any => { // need to fix any
|
||||||
|
if (filter !== 'all') return affairs.filter((a: AffairType) => a.priority === filter)
|
||||||
|
|
||||||
return affairs // need to fix
|
return affairs // need to fix
|
||||||
}
|
}
|
||||||
export const deleteAffair = (affairs: any, _id: any): any => { // need to fix any
|
export const deleteAffair = (affairs: any, _id: any): any => { // need to fix any
|
||||||
|
|
||||||
return affairs // need to fix
|
return affairs.filter((a: AffairType) => a._id !== _id) // need to fix
|
||||||
}
|
}
|
||||||
|
|
||||||
function HW2() {
|
function HW2() {
|
||||||
|
|||||||
Reference in New Issue
Block a user