File tree Expand file tree Collapse file tree 5 files changed +10
-8
lines changed Expand file tree Collapse file tree 5 files changed +10
-8
lines changed Original file line number Diff line number Diff line change 1- const pluginId = 'versioning '
1+ import pluginPkg from '../../package.json '
22
3- module . exports = pluginId
3+ const pluginId = pluginPkg . name . replace ( / ^ s t r a p i - p l u g i n - / i, '' )
4+
5+ export default pluginId
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ module.exports = async () => {
44 section : 'plugins' ,
55 displayName : 'Access to restore and view old entry versions' ,
66 uid : 'restore' ,
7- pluginName : 'versioning'
7+ pluginName : 'versioning-mongo '
88 }
99 ]
1010
Original file line number Diff line number Diff line change 11module . exports = {
22 list : async ( ctx ) => {
33 const { id } = ctx . params
4- const versionModel = strapi . plugins . versioning . models . version
4+ const versionModel = strapi . plugins [ ' versioning-mongo' ] . models . version
55 const versions = await versionModel . find ( { entryId : id } ) . lean ( )
66
77 ctx . send ( versions )
88 } ,
99
1010 getVersion : async ( ctx ) => {
1111 const { id } = ctx . params
12- const versionModel = strapi . plugins . versioning . models . version
12+ const versionModel = strapi . plugins [ ' versioning-mongo' ] . models . version
1313 const version = await versionModel . findById ( id ) . lean ( )
1414
1515 ctx . send ( version )
Original file line number Diff line number Diff line change @@ -127,7 +127,7 @@ const Header = ({
127127 label : 'View Versions' ,
128128 onClick : ( ) => {
129129 const id = location . pathname . split ( '/' ) . pop ( )
130- push ( `/plugins/versioning?entryId=${ id } ` )
130+ push ( `/plugins/versioning-mongo ?entryId=${ id } ` )
131131 } ,
132132 color : 'secondary' ,
133133 type : 'button'
Original file line number Diff line number Diff line change 11module . exports = strapi => ( {
22 initialize ( ) {
3- const versioningPlugin = strapi . plugins . versioning
4- const versioningService = versioningPlugin . services [ ' versioning-mongo' ]
3+ const versioningPlugin = strapi . plugins [ ' versioning-mongo' ]
4+ const versioningService = versioningPlugin . services . versioning
55 const versionModel = versioningPlugin . models . version
66
77 const newVersionMethods = [ 'PUT' , 'POST' ]
You can’t perform that action at this time.
0 commit comments