Create FeedItems when Posting and Sort Feed
Fullstack Social iOS NodeJS REST
In the last episode, we implemented FeedItems for all of the posts that belong to users that we follow. In this lesson, let's wrap up the main feed by also including our own posts in the home page. This is done easily by creating a FeedItem whenever we create a post in the system. Finally I'll also show you how to sort your objects by including a date property on your feed items.

Comments (2)
3 years ago
Hey Brian, I noticed that when I choose a file to upload, the modal stretches outside of the current window frame if the image is large. And since it is statically placed, there's no way to click on the "create" or "cancel" buttons. Do you know of a way to either scroll on this modal down to the bottom, or a way to ensure that the entire modal remains in-frame?
Brian Voong
3 years ago
3 years ago
Hey Brian: do you know why i cant implement an error throw on this file uploader helper, my code is as follows: On the Helper Module: got the exit: uploadError: { description: 'Error cuando las credenciales o la conectividad con AWS esta quebrada', message: 'No se pudo conectar con el servidor AWS' } file.upload(options, async (err, files) => { if (err) { throw 'uploadError'; } //Success const fileUrl = files[0].extra.Location; return exits.success(fileUrl); }); and on the create-post file i got the same try block you got but with an interceptor (implemented just as the docs said.) try { const fileUrl = await sails.helpers.fileuploader(file, bucket) .intercept('uploadError', 'message'); And the only error i got on the server is the following: node:14090) UnhandledPromiseRejectionWarning: uploadError (node:14090) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see (rejection id: 1) (node:14090) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. Any ideas what am i missing?