I think if id is nocard, we can just return early just like id is null, or more, we probably can use if else like:
if (id === null) {
...
} else if (id === 'nocard') {
...
} else {
...
}