MCPcopy Create free account
hub / github.com/Muhammadsiddiq-code/Admin-dashboard / exportData

Function exportData

app.js:891–910  ·  view source on GitHub ↗
(type)

Source from the content-addressed store, hash-verified

889
890// Export functions
891function exportData(type) {
892 let data, filename
893
894 switch (type) {
895 case "students":
896 data = sampleData.students
897 filename = "oquvchilar.csv"
898 break
899 case "teachers":
900 data = sampleData.teachers
901 filename = "oqituvchilar.csv"
902 break
903 default:
904 return
905 }
906
907 const csv = convertToCSV(data)
908 downloadCSV(csv, filename)
909 showNotification(`${type} ma'lumotlari yuklab olindi!`, "success")
910}
911
912function convertToCSV(data) {
913 if (!data.length) return ""

Callers 1

setupButtonListenersFunction · 0.85

Calls 3

convertToCSVFunction · 0.85
downloadCSVFunction · 0.85
showNotificationFunction · 0.85

Tested by

no test coverage detected