Ajax Request pri dotaze na preseter a jeho akciu

KristianSubweb
Člen | 144
+
0
-

Ahojte nevedeli by ste poradiť? Ajaxovím requestom sa chcem pozrieť na danú akciu prerentera lenže pri dotaze nastane chyba že mi chýba latte súbor pre danú akciu ktorú chcem navštíviť.

Toto je vporiadku dotaz na danú adresu pošle.

$.nette.ajax({
                url: {link RestCars:getGetContactCars},
                data: {
                    contactID: contactID
                },
                start: function() {
                    cleanContactCars();
                },
                success: function(payload) {
                    var result = JSON.parse(payload.result);

                    console.log(result);

                    $.each(result, function(key, value) {
                        selectContactCars.append($('<option class="realoption"></option>').val(key).html(value));
                    });

                    // enable it
                    selectContactCars.attr("disabled", false);
                }
            });

Presenter akcie na ktorú sa chcem pozrieť.

<?php

namespace OrdersModule\Presenters;

use Nette\Application\UI\Presenter;
use Nette\Database\Context;
use Nette\Utils\DateTime;
use Nette\Utils\Json;

class RestCarsPresenter extends Presenter {

    /** @var Context @inject */
    public $database;

    /* Vracia všetky vozidla prisluchajúce konkrétnemu kontaktu */
    public function actionGetContactCars( $contactID ){

        $data = [
            "contactId" => $contactID,
            2 => "BL 567KL",
            3 => "KE 766KL"
        ];

        $this->payload->data = Json::encode($data);
        $this->sendPayload();

    }

}

A chyba: Page not found. Missing template ‚…/OrdersModule/presenters/templates/RestCars/getGetContactCars.latte‘.

rkor
Člen | 62
+
0
-

Řekl bych, že tam máš chybu – 2× get
getGetContactCars

KristianSubweb
Člen | 144
+
0
-

rkor napsal(a):

Řekl bych, že tam máš chybu – 2× get
getGetContactCars

Ano :D :D :D ďakujem bolo to vtom :D