Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3381031
D7375.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
705 B
Referenced Files
None
Subscribers
None
D7375.diff
View Options
diff --git a/keyserver/src/updaters/upload-updaters.js b/keyserver/src/updaters/upload-updaters.js
--- a/keyserver/src/updaters/upload-updaters.js
+++ b/keyserver/src/updaters/upload-updaters.js
@@ -38,4 +38,22 @@
await dbQuery(query);
}
-export { assignImages, assignMessageContainerToMedia };
+async function assignUserContainerToMedia(
+ viewer: Viewer,
+ mediaID: string,
+): Promise<void> {
+ const query = SQL`
+ UPDATE uploads
+ SET container = ${viewer.id}
+ WHERE id = ${mediaID}
+ AND uploader = ${viewer.id}
+ AND container IS NULL
+ `;
+ await dbQuery(query);
+}
+
+export {
+ assignImages,
+ assignMessageContainerToMedia,
+ assignUserContainerToMedia,
+};
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Nov 29, 3:45 AM (22 h, 5 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2595639
Default Alt Text
D7375.diff (705 B)
Attached To
Mode
D7375: [keyserver] Introduce `assignUserContainerToMedia`
Attached
Detach File
Event Timeline
Log In to Comment