on master help sign in
pages/application: filter canceled, sort by recent
2e58af9Matilde Park
pages/applications/[[...application]].js+3−1
@@ -181,7 +181,9 @@ export const getServerSideProps = async ({ params, res }) => {
181 ? JSON.stringify(Markdown.parse({ post: { content } }))
181 ? JSON.stringify(Markdown.parse({ post: { content } }))
182 : null;
182 : null;
183
183
184− const matchedGrants = getGrantsByShortcode(params.application) || null;
184+ const matchedGrants = getGrantsByShortcode(params.application)
185+ .filter((e) => !e.extra.canceled)
186+ .sort((a, b) => new Date(b.date) - new Date(a.date))
185
187
186 if (!data.title) {
188 if (!data.title) {
187 data = {
189 data = {