susansli / augury

Augury is a web application that uses AI to help users decide which stocks to buy. In addition, it displays data pertaining to the portfolios the user has saved, such as current valuation of all stocks held.
0 stars 0 forks source link

[User Account] [Backend] Get a user #48

Open susansli opened 1 week ago

susansli commented 1 week ago

Story

As a system, we need to be able to fetch a user that is associated with an account.

Specifications

The flow should go something like:

Acceptance

crystal-g77 commented 4 days ago

To use, send a Get request to /protected/User eg. const response = await fetch('http://localhost:3333/protected/User', { method: 'GET', credentials: 'include',
headers: { 'Content-Type': 'application/json', } }); if (response.ok) { const data = await response.json(); const user = data.user; document.getElementById('userDetails').innerHTML = `

User Updated Successfully!

                <p><strong>ID:</strong> ${user._id}</p>
                <p><strong>Email:</strong> ${user.email}</p>
                <p><strong>First Name:</strong> ${user.firstName}</p>
                <p><strong>Last Name:</strong> ${user.lastName}</p>
                <p><strong>Balance:</strong> ${user.balance}</p>
            `;
        }