Skip to content

drupal_internal__*id is typed as string - should it be number? #686

Open
@MartinDavi

Description

@MartinDavi

Package containing the bug

next-drupal (NPM package)

Describe the bug

Hey, in types.ts we have:

export interface DrupalTaxonomyTerm extends JsonApiResourceWithPath {
  drupal_internal__tid: string
  changed: string
  default_langcode: boolean
  name: string
  description: string
  weight: number
}

But when I fetch terms from the jsonapi, drupal_internal__tid is a number. Same if it's a node id or what have you.

This just caused a tricky bug where I was trying to compare a string with a number which of course wasn't working.

I'm on 1.6.0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions