Keep Drive files in named folders of one shared drive
GOOGLE_SHARED_DRIVE (the shared drive's bare id) replaces GOOGLE_DRIVE_FOLDER. driveUpload takes a folder path, found by name in the shared drive or made the first time, so each use gets its own folder: "Requests" for the Request form now, others later. The docs say plainly that the setting is the id only, not the address. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
e7743829be
commit
0f6a796021
4 changed files with 113 additions and 30 deletions
|
|
@ -40,6 +40,8 @@ const CATEGORIES = {
|
|||
|
||||
const LIMITS = { name: 120, email: 254, subject: 200, message: 5000 };
|
||||
const MIN_MESSAGE = 10;
|
||||
// Where in the shared drive the files go (googleService.js).
|
||||
const DRIVE_FOLDER = "Requests";
|
||||
export const MAX_FILES = 3;
|
||||
export const MAX_FILE_BYTES = 10 * 1024 * 1024;
|
||||
|
||||
|
|
@ -132,7 +134,7 @@ requests.post(
|
|||
const stored = [];
|
||||
try {
|
||||
for (const file of uploads) {
|
||||
stored.push({ ...file, driveId: await driveUpload(`Request ${id} - ${file.name}`, file.mime, file.buffer) });
|
||||
stored.push({ ...file, driveId: await driveUpload(DRIVE_FOLDER, `Request ${id} - ${file.name}`, file.mime, file.buffer) });
|
||||
}
|
||||
} catch (err) {
|
||||
console.warn(`feedback #${id}: Drive upload failed: ${err.message}`);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue