read project creation request notification working
This commit is contained in:
parent
c75c5e1d8a
commit
7038185e7f
2 changed files with 12 additions and 1 deletions
|
|
@ -8,7 +8,8 @@ return [
|
||||||
$data = json_decode($json);
|
$data = json_decode($json);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$project = page($data->projectId);
|
$project = page("projects")->findPageOrDraft($data->projectId);
|
||||||
|
|
||||||
$project->readNotification($data->notificationId);
|
$project->readNotification($data->notificationId);
|
||||||
return json_encode([
|
return json_encode([
|
||||||
"status" => "success"
|
"status" => "success"
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<article
|
<article
|
||||||
|
@click="read()"
|
||||||
v-if="useUserStore.role !== 'client'"
|
v-if="useUserStore.role !== 'client'"
|
||||||
class="notification | bg-white rounded-lg | p-16 | flow"
|
class="notification | bg-white rounded-lg | p-16 | flow"
|
||||||
data-type="project-request"
|
data-type="project-request"
|
||||||
|
|
@ -39,8 +40,17 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { useNotificationsStore } from "../../stores/notifications";
|
import { useNotificationsStore } from "../../stores/notifications";
|
||||||
import { useUserStore } from "../../stores/user";
|
import { useUserStore } from "../../stores/user";
|
||||||
|
import { useApiStore } from "../../stores/api";
|
||||||
|
|
||||||
const { notification } = defineProps({ notification: Object });
|
const { notification } = defineProps({ notification: Object });
|
||||||
const { formatDate } = useNotificationsStore();
|
const { formatDate } = useNotificationsStore();
|
||||||
const { user } = useUserStore();
|
const { user } = useUserStore();
|
||||||
|
const api = useApiStore();
|
||||||
|
|
||||||
|
async function read() {
|
||||||
|
const response = await api.readNotification(
|
||||||
|
notification.id,
|
||||||
|
notification.project.uri
|
||||||
|
);
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue