update testing (remove all later)

This commit is contained in:
Ben Irvin 2022-08-18 10:29:48 +02:00
parent e28c9e7ec9
commit 4f46d57de0

View File

@ -19,19 +19,24 @@ module.exports = {
async bootstrap({ strapi }) {
// Delete tokens
// const tokens = await strapi.admin.services['api-token'].list();
// console.log('tokens', tokens);
// const promises = [];
// tokens.forEach(({ id }) => {
// promises.push(strapi.admin.services['api-token'].revoke(id));
// });
// await Promise.all(promises);
// Create a token
// // Create a token
// const payload = {
// type: 'custom',
// permissions: ['api::restaurant.create'],
// permissions: ['api::restaurant.restaurant.find'],
// name: 'custom token v2',
// };
// const token = await strapi.admin.services['api-token'].create(payload);
// console.log('custom-before', JSON.stringify(token, null, 2));
// // TODO: Really need to allow update without full permissions array!
// await strapi.admin.services['api-token'].update(token.id, {
// lastUsed: new Date(),
// });
// const updatedToken = await strapi.admin.services['api-token'].update(token.id, {
// description: 'foobar',
// permissions: ['api::restaurant.restaurant.find', 'api::restaurant.restaurant.findOne'],