redesign user data api

This commit is contained in:
isUnknown 2024-10-28 15:33:52 +01:00
parent f132049948
commit 44361e614d
17 changed files with 80 additions and 52 deletions

View file

@ -1,19 +1,2 @@
<script>
<?php if ($kirby->user()): ?>
const kirbyData = {
user: {
role: '<?= $kirby->user()->role() ?>',
uuid: '<?= $kirby->user()->uuid() ?>',
notifications: <?= json_encode(Yaml::decode($kirby->user()->notifications()->value())) ?>
<?php if ($kirby->user()->role() == 'client'): ?>
client: {
name: '<?= $kirby->user()->client()->toPage()->title() ?>',
uuid: '<?= $kirby->user()->client()->toPage()->uuid() ?>',
}
<?php endif ?>
}
}
<?php endif ?>
</script>
</body>
</html>