@blessmesanta/strapi-google-maps
Version:
A Google Maps custom field for Strapi, allowing you to pick a location.
65 lines (64 loc) • 2.09 kB
JavaScript
;
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.sanitizeConfigInput = void 0;
const utils = __importStar(require("@strapi/utils"));
const { sanitize } = utils;
const { contentAPI } = sanitize;
const schema = {
kind: 'singleType',
collectionName: 'google_maps_configs',
info: {
singularName: 'config',
pluralName: 'configs',
// @ts-ignore
displayName: 'Google Maps Config',
},
options: {
// @ts-ignore
draftAndPublish: false,
},
pluginOptions: {
'content-manager': {
visible: false,
},
'content-type-builder': {
visible: false,
},
},
attributes: {
googleMapsKey: {
type: 'string',
default: '',
required: true,
configurable: false,
},
},
};
exports.default = schema;
function sanitizeConfigInput(data, ctx) {
return contentAPI.input(data, schema, ctx.state.auth);
}
exports.sanitizeConfigInput = sanitizeConfigInput;