@websolutespa/payload-plugin-bowl
Version:
Bowl PayloadCms plugin of the BOM Repository
66 lines (65 loc) • 1.81 kB
JavaScript
import { hasRole } from '../core';
import { roles } from '../types';
export const Country = (options)=>({
type: 'withStatic',
src: 'https://actarian.github.io/cms-i18n-react/api/country.json',
slug: options.slug.country,
admin: {
hidden: (args)=>!hasRole(args.user, roles.Admin)
},
/*
map: {
continentId: 'continent',
subContinentId: 'subContinent',
},
*/ fields: [
{
name: 'id',
label: 'ID',
type: 'text'
},
{
name: 'name',
label: 'Name',
type: 'text',
localized: true
},
{
name: 'englishName',
label: 'English Name',
type: 'text'
},
{
name: 'nativeName',
label: 'Native Name',
type: 'text'
},
{
name: 'alpha2Code',
label: 'Alpha2 Code',
type: 'text'
},
{
name: 'alpha3Code',
label: 'Alpha3 Code',
type: 'text'
},
{
name: 'continent',
label: 'Continent',
type: 'relationship',
relationTo: options.slug.continent,
hasMany: false,
required: true
},
{
name: 'subContinent',
label: 'Sub Continent',
type: 'relationship',
relationTo: options.slug.subContinent,
hasMany: false,
required: true
}
]
});
//# sourceMappingURL=Country.js.map