Skip to content

Commit

Permalink
Merge pull request #251 from szepeviktor/szepeviktor-patch-2
Browse files Browse the repository at this point in the history
Use switch/case in Link
  • Loading branch information
fabiankaegy authored Oct 23, 2023
2 parents e9cb8d5 + 97f757b commit f2609b0
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions components/link/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,14 @@ function getSuggestionsQuery(type, kind) {
return { type: 'term', subtype: 'post_tag' };
case 'post_format':
return { type: 'post-format' };
}

switch (kind) {
case 'taxonomy':
return { type: 'term', subtype: type };
case 'post-type':
return { type: 'post', subtype: type };
default:
if (kind === 'taxonomy') {
return { type: 'term', subtype: type };
}
if (kind === 'post-type') {
return { type: 'post', subtype: type };
}
return {};
}
}
Expand Down

0 comments on commit f2609b0

Please sign in to comment.