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