Skip to content

Commit

Permalink
Deleted unused func & export (found by Knip)
Browse files Browse the repository at this point in the history
  • Loading branch information
DuncanRitchie committed Dec 4, 2024
1 parent 9d0dc12 commit 635e920
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 21 deletions.
2 changes: 1 addition & 1 deletion components/lemma/Lemma.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -240,4 +240,4 @@ const Lemma = ({ lemma, linkBase, currentWordHyphenated, showFormsAndCognates =
}

export default Lemma
export { getLemmaId, shouldGeneratedFormsBeShownForLemma }
export { getLemmaId }
18 changes: 1 addition & 17 deletions lib/lemmata/count.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import dbConnect from '../dbConnect'
import Lemma from '../../models/Lemma'

export async function count() {
export default async function count() {
try {
await dbConnect()
const count = await Lemma.estimatedDocumentCount()
Expand All @@ -10,19 +10,3 @@ export async function count() {
return { success: false }
}
}

export default async function handler(req, res) {
switch (req.method) {
case 'GET':
const data = await count()
if (data.success) {
res.status(200).json(data)
} else {
res.status(400).json(data)
}
break
default:
res.status(400).json({ success: false })
break
}
}
2 changes: 1 addition & 1 deletion lib/words/count.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import dbConnect from '../dbConnect'
import Word from '../../models/Word'

export async function count() {
export default async function count() {
try {
await dbConnect()
const count = await Word.estimatedDocumentCount()
Expand Down
4 changes: 2 additions & 2 deletions pages/about.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import Head from 'next/head'
import Header from '../components/header/Header'
import Search from '../components/search/Search'
import superscriptLemmaTag from '../components/lemma/superscriptLemmaTag'
import { count as wordsCount } from '../lib/words/count'
import { count as lemmataCount } from '../lib/lemmata/count'
import wordsCount from '../lib/words/count'
import lemmataCount from '../lib/lemmata/count'
import { getShowGeneratedFormsString } from '../lib/lemmata'
import styles from '../css/About.module.css'
import AboutContents from '../components/aboutContents/AboutContents'
Expand Down

0 comments on commit 635e920

Please sign in to comment.