Add last active date to user profile #16
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fixes (partially) #3
Note that the generated files changed slightly because I changed the database layout, so I had to regenerate them. This means that front/graphql.schema.json and front/src/generated/graphql.ts contains a lot of changes, but these were all done automatically with a simple
yarn codegenThis adds a new column "Last active" to the Users admin view.
changes
api
ctfnote.profile:COLUMN "lastactive" timestamptz NOT NULL DEFAULT CURRENT_TIMESTAMP;ctfnote.update_last_active_responsewhich only contains a single boolean (ok)ctfnote.update_last_active()which sets thelastactivecolumn of the current userid tonow(), anyuser_guestmay call this function.Note that
ctfnote.profileisSELECT-able by any logged in users. This means that using the API any user can view the last active date of any other users. I can change this if needed, but I since many forums also have a public "last online" date, I thought I'd make this internally public as well.front
lastactivetoProfileFragmentandProfileupdateLastActivemutationupdateLastActivemutation every time the user clicks a linkuser.profile.lastactiveto Users.vue view