mirror of https://github.com/iconify/api.git
fix: return empty object for /last-modified route if icon sets are missing
This commit is contained in:
parent
c712d9c85f
commit
5b468c8100
|
|
@ -24,7 +24,6 @@ export function generateLastModifiedResponse(query: FastifyRequest['query'], res
|
|||
const response: APIv3LastModifiedResponse = {
|
||||
lastModified,
|
||||
};
|
||||
let found = false;
|
||||
|
||||
for (let i = 0; i < prefixes.length; i++) {
|
||||
const prefix = prefixes[i];
|
||||
|
|
@ -32,16 +31,10 @@ export function generateLastModifiedResponse(query: FastifyRequest['query'], res
|
|||
if (item) {
|
||||
const value = item.item.common.lastModified;
|
||||
if (value) {
|
||||
found = true;
|
||||
lastModified[prefix] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!found) {
|
||||
// No matches
|
||||
res.send(404);
|
||||
return;
|
||||
}
|
||||
sendJSONResponse(response, q, wrap, res);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ export interface APIv2CollectionResponse {
|
|||
chars?: Record<string, string>;
|
||||
|
||||
// Themes
|
||||
themes?: IconifyJSON['themes'];
|
||||
themes?: IconifyJSON['themes']; // Deprecated, so it can be ignored
|
||||
prefixes?: IconifyJSON['prefixes'];
|
||||
suffixes?: IconifyJSON['suffixes'];
|
||||
}
|
||||
|
|
@ -127,7 +127,7 @@ export interface APIv2SearchResponse {
|
|||
// Number of results. If same as `limit`, more results are available
|
||||
total: number;
|
||||
|
||||
// Number of results shown
|
||||
// Maximum number of items allowed by query
|
||||
limit: number;
|
||||
|
||||
// Index of first result
|
||||
|
|
|
|||
Loading…
Reference in New Issue