@simplelayer/graniteer-core 0.3.28 → 0.3.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -99,6 +99,21 @@ export async function handle(req) {
|
|
|
99
99
|
return json(500, { ok: false, error: 'read_failed' });
|
|
100
100
|
if (!row)
|
|
101
101
|
return json(404, { ok: false, error: 'not_found' });
|
|
102
|
+
if (action === 'get_signed_url' || action === 'mark_printed') {
|
|
103
|
+
const { data: profile, error: optOutErr } = await admin
|
|
104
|
+
.from('member_profiles')
|
|
105
|
+
.select('wall_photo_opt_out')
|
|
106
|
+
.eq('auth_user_id', row.auth_user_id)
|
|
107
|
+
.maybeSingle();
|
|
108
|
+
if (optOutErr)
|
|
109
|
+
return json(500, { ok: false, error: 'opt_out_check_failed' });
|
|
110
|
+
if (profile?.wall_photo_opt_out === true) {
|
|
111
|
+
if (action === 'mark_printed') {
|
|
112
|
+
await audit({ queue_id: id, auth_user_id: row.auth_user_id, refused: 'opted_out' });
|
|
113
|
+
}
|
|
114
|
+
return json(409, { ok: false, error: 'opted_out' });
|
|
115
|
+
}
|
|
116
|
+
}
|
|
102
117
|
if (action === 'get_signed_url') {
|
|
103
118
|
if (!row.original_object_path)
|
|
104
119
|
return json(400, { ok: false, error: 'no_original_captured' });
|