2023-03-03 15:54:28 +00:00
|
|
|
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext';
|
|
|
|
// import Person from 'App/Models/Person';
|
|
|
|
import Dataset from 'App/Models/Dataset';
|
|
|
|
|
|
|
|
// node ace make:controller Author
|
|
|
|
export default class DatasetController {
|
2023-06-22 15:20:04 +00:00
|
|
|
public async index({}: HttpContextContract) {
|
|
|
|
// select * from gba.persons
|
|
|
|
// where exists (select * from gba.documents inner join gba.link_documents_persons on "documents"."id" = "link_documents_persons"."document_id"
|
|
|
|
// where ("link_documents_persons"."role" = 'author') and ("persons"."id" = "link_documents_persons"."person_id"));
|
|
|
|
const datasets = await Dataset.query().where('server_state', 'published').orWhere('server_state', 'deleted');
|
|
|
|
|
|
|
|
return datasets;
|
|
|
|
}
|
2023-03-03 15:54:28 +00:00
|
|
|
}
|