LogoLogo
Join our community
  • AdminJS
  • Contribute
  • Demo
  • Addons Marketplace
  • Installation
    • Getting started
    • Plugins
      • Adonis
      • Express
      • Nest
      • Fastify
      • Hapi
      • Koa
      • Community Plugins
        • FeathersJS
        • AdonisJS
      • Matrix
    • Adapters
      • TypeORM
      • Sequelize
      • Prisma
      • MikroORM
      • Objection
      • SQL
      • Mongoose
      • Community Adapters
        • AdonisJS
    • What's new in v7?
    • Migration Guide v7
  • Basics
    • Resource
    • Action
    • Property
    • Features
      • Relations
      • Upload
      • Logger
      • Import & Export
      • Password
      • Leaflet Maps
      • Writing your own features
    • API
      • List
      • New
      • Search
      • Show
      • Edit
      • Delete
      • Bulk Delete
    • Themes
    • Authentication
      • FirebaseAuthProvider
      • MatrixAuthProvider
  • How to write an addon?
  • UI Customization
    • Writing your own Components
    • Overwriting CSS styles
    • Dashboard customization
    • Changing the form view
    • Storybook
  • Tutorials
    • Role-Based Access Control
    • Internationalization (i18n)
    • Content Management System
    • Custom components library
    • Custom component internationalization
  • FAQ
    • PDF Generator
    • Charts
    • Forgot Password
  • ⚠️Legacy documentation
Powered by GitBook
On this page
  1. Basics
  2. API

Search

allows you to search records in a given resource by a query string (by default it's the title property)

Endpoint: /api/resources/[RESOURCE-ID]/actions/search/[SEARCH-PHRASE]?[SEARCH-CONDITIONS]

Method: GET

Request params:

  • title - searching by title

  • filers.[field_name] - searching by field values

  • page - requested page number

  • perPage - number of records per page (max 500)

  • sortBy - id of the sorting column

  • direction - sorting direction, possible values asc,desc

Response:

  • records - list of records with resource metadata

    • record - record you're requesting

      • params - all record data

      • id - record id

      • title - record title

      • recordActions- list all actions and their parameters available on this record

      • bulkActions- list of all bulk actions and their parameters available on this record

Example:

{
   "records":[
      {
         "params":{
            "id":2,
            "name":"Games",
            "createdAt":"2023-01-30T13:01:39.597Z",
            "updatedAt":"2023-01-30T13:01:39.597Z"
         },
         "populated":{
            
         },
         "baseError":null,
         "errors":{
            
         },
         "id":2,
         "title":"Games",
         "recordActions":[
            {
               "name":"show",
               "actionType":"record",
               "icon":"Screen",
               "label":"Show",
               "resourceId":"categories",
               "guard":"",
               "showFilter":false,
               "showResourceActions":true,
               "showInDrawer":false,
               "hideActionHeader":false,
               "containerWidth":1,
               "layout":null,
               "variant":"default",
               "parent":null,
               "hasHandler":true,
               "custom":{
                  
               }
            },
            {
               "name":"edit",
               "actionType":"record",
               "icon":"Edit",
               "label":"Edit",
               "resourceId":"categories",
               "guard":"",
               "showFilter":false,
               "showResourceActions":true,
               "showInDrawer":false,
               "hideActionHeader":false,
               "containerWidth":1,
               "layout":null,
               "variant":"default",
               "parent":null,
               "hasHandler":true,
               "custom":{
                  
               }
            },
            {
               "name":"delete",
               "actionType":"record",
               "icon":"TrashCan",
               "label":"Delete",
               "resourceId":"categories",
               "guard":"Do you really want to remove this item?",
               "showFilter":false,
               "showResourceActions":true,
               "component":false,
               "showInDrawer":false,
               "hideActionHeader":false,
               "containerWidth":1,
               "layout":null,
               "variant":"danger",
               "parent":null,
               "hasHandler":true,
               "custom":{
                  
               }
            }
         ],
         "bulkActions":[
            {
               "name":"bulkDelete",
               "actionType":"bulk",
               "icon":"Delete",
               "label":"Delete all",
               "resourceId":"categories",
               "guard":"",
               "showFilter":false,
               "showResourceActions":true,
               "showInDrawer":true,
               "hideActionHeader":false,
               "containerWidth":"500px",
               "layout":null,
               "variant":"danger",
               "parent":null,
               "hasHandler":true,
               "custom":{
                  
               }
            }
         ]
      }
   ]
}
PreviousNewNextShow

Last updated 2 years ago

Endpoint:

https://adminjs-demo.herokuapp.com/admin/api/resources/categories/actions/search/Games