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 codegen
This adds a new column "Last active" to the Users admin view.
changes
api
adds a new column to ctfnote.profile: COLUMN "lastactive" timestamptz NOT NULL DEFAULT CURRENT_TIMESTAMP;
adds a new type ctfnote.update_last_active_response which only contains a single boolean (ok)
adds a new function ctfnote.update_last_active() which sets the lastactive column of the current userid to now(), any user_guest may call this function.
Note that ctfnote.profile is SELECT-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
add lastactive to ProfileFragment and Profile
add new updateLastActive mutation
call updateLastActive mutation every time the user clicks a link
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 codegen
This 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_response
which only contains a single boolean (ok
)ctfnote.update_last_active()
which sets thelastactive
column of the current userid tonow()
, anyuser_guest
may call this function.Note that
ctfnote.profile
isSELECT
-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
lastactive
toProfileFragment
andProfile
updateLastActive
mutationupdateLastActive
mutation every time the user clicks a linkuser.profile.lastactive
to Users.vue view