Skip to content

'data.toISOString is not a function' #93

@gplusdotgr

Description

@gplusdotgr

'TypeError: data.toISOString is not a function

stuck in this for hours.. any help would be appreciated!

      const date = new Date().toISOString();
      const response = await eventsApi.createEvent({
        data: {
          type: "event",
          attributes: {
            properties: {
              hotelId,
              checkInDate,
              checkOutDate,
              bookingId,
              firstName,
            },
            time: date,
            uniqueId:"696b3941-6ec8-42cc-854f-1f90be51d8de",
            metric : {
              "data": {
                "type": "metric",
                "attributes": {
                  "name": "Placed Order"
                }
              }
            },
            profile: {
              data: {
                type: 'profile',
                attributes: {
                  email: recipientEmail,
                }
              }
            }
          }
        }
      });

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions