package de.thpeetz.kontor.web;

import java.util.List;

import de.thpeetz.kontor.infrastructure.AppHibernate;
import de.thpeetz.kontor.models.comics.Comic;
import de.thpeetz.kontor.models.comics.ComicQueries_;
import de.thpeetz.kontor.web.model.ResultComic;
import io.javalin.http.Handler;

public class ComicHandler {
    public static Handler listAll = (context) -> {
        List<Comic> result = AppHibernate.fromTransaction(ComicQueries_::getAllComics);
        context.json(new ResultComic(result));
    };

}
