feat: add notifications system with bell badge, polling, Directus flows, and webhook integration
This commit is contained in:
@@ -109,10 +109,23 @@ if ($directusStatus >= 400) {
|
||||
exit;
|
||||
}
|
||||
|
||||
// Create notification for listing owner
|
||||
$listingData = json_decode($directusResponse, true);
|
||||
// Fetch listing to get owner
|
||||
$getUrl = DIRECTUS_URL . '/items/listings/' . urlencode($listingId) . '?fields=user_created';
|
||||
$gch = curl_init($getUrl);
|
||||
curl_setopt_array($gch, [
|
||||
CURLOPT_HTTPHEADER => [
|
||||
'Authorization: Bearer ' . DIRECTUS_TOKEN,
|
||||
],
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_TIMEOUT => 5,
|
||||
]);
|
||||
$getResponse = curl_exec($gch);
|
||||
curl_close($gch);
|
||||
|
||||
$listingData = json_decode($getResponse, true);
|
||||
$userCreated = $listingData['data']['user_created'] ?? null;
|
||||
|
||||
// Create notification for listing owner
|
||||
if ($userCreated) {
|
||||
$notifPayload = json_encode([
|
||||
'user_hash' => $userCreated,
|
||||
|
||||
Reference in New Issue
Block a user