Skip to content

Commit

Permalink
fix: referent zone to environnement
Browse files Browse the repository at this point in the history
  • Loading branch information
ClementNumericite committed Jul 22, 2021
1 parent 6ae8f45 commit f8b4812
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 10 deletions.
2 changes: 1 addition & 1 deletion back-strapi/api/referent/models/referent.settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"email": {
"type": "email"
},
"zone": {
"environnement": {
"model": "environnement"
},
"address": {
Expand Down
62 changes: 53 additions & 9 deletions back-strapi/config/functions/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,71 @@ module.exports = () => {

const tumpeplayConditions = [
{
displayName: 'Zone métropole',
category: 'Tumeplay',
name: 'zone-metropole',
displayName: 'Zone métropole simple',
category: 'Tumeplay-Métropole',
name: 'simple-zone-metropole',
plugin: 'admin',
async handler() {
return {
'theme.environnement': 1
'environnement.id': 1,
};
}
},
{
displayName: 'Zone guyane',
category: 'Tumeplay',
name: 'zone-guyane',
displayName: 'Zone guyane simple',
category: 'Tumeplay-Guyane',
name: 'simple-zone-guyane',
plugin: 'admin',
async handler() {
return {
'theme.environnement': 2
'environnement.id': 2,
};
}
}
},
{
displayName: 'Zone métropole thèmes',
category: 'Tumeplay-Métropole',
name: 'theme-zone-metropole',
plugin: 'admin',
async handler() {
return {
'theme.environnement': 1,
};
}
},
{
displayName: 'Zone guyane thèmes',
category: 'Tumeplay-Guyane',
name: 'theme-zone-guyane',
plugin: 'admin',
async handler() {
return {
'theme.environnement': 2,
};
}
},
{
displayName: 'Zone métropole commandes',
category: 'Tumeplay-Métropole',
name: 'order-zone-metropole',
plugin: 'admin',
async handler() {
return {
'address_deptcode_ne': '973',
};
}
},
{
displayName: 'Zone guyane commandes',
category: 'Tumeplay-Guyane',
name: 'order-zone-guyane',
plugin: 'admin',
async handler() {
return {
'address_deptcode': '973',
};
}
},
]

strapi.admin.services.permission.conditionProvider.registerMany(tumpeplayConditions);
Expand Down

0 comments on commit f8b4812

Please sign in to comment.