Skip to content

Can't get this to work with element-api #75

@Coysh

Description

@Coysh

Not sure if it's something I'm doing wrong, but adding isNotPast to criteria doesn't seem to work:

'api/markers-events.json' => function () {
	return [
		'elementType' => Entry::class,
		'criteria' => [
			'section' => ['events'],
			'latitude' => ':notempty:',
			'longitude' => ':notempty:',
			'isNotPast' => ['eventDate', 'event'],
		],
		'paginate' => false,
		'cache' => false,
		'transformer' => function (Entry $entry) {
			return [
				'id' => $entry->id,
				'title' => $entry->title,
				'latitude' => $entry->latitude,
				'longitude' => $entry->longitude,
				'type' => $entry->type->handle,
			];
		},
	];
},

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