Fix, placeholder image, api
Added a placeholder image, code style Fixed metadata missing issue More work on api
This commit is contained in:
parent
529d106351
commit
0e036b152b
8 changed files with 192 additions and 94 deletions
|
@ -165,7 +165,37 @@ func linstromUpdateAccount(w http.ResponseWriter, r *http.Request) {
|
|||
log.Error().Err(err).Msg("Failed to marshal and write updated account")
|
||||
}
|
||||
}
|
||||
func linstromDeleteAccount(w http.ResponseWriter, r *http.Request) {}
|
||||
func linstromDeleteAccount(w http.ResponseWriter, r *http.Request) {
|
||||
actorId, _ := ActorIdFromRequest(r)
|
||||
log := hlog.FromRequest(r)
|
||||
store := StorageFromRequest(r)
|
||||
targetAccountId := AccountIdFromRequest(r)
|
||||
if targetAccountId != actorId {
|
||||
other.HttpErr(w, HttpErrIdNotAuthenticated, "Action forbidden", http.StatusForbidden)
|
||||
return
|
||||
}
|
||||
acc, err := store.FindAccountById(targetAccountId)
|
||||
if err != nil {
|
||||
log.Error().Err(err).Str("account-id", actorId).Msg("Failed to get account for deletion")
|
||||
other.HttpErr(
|
||||
w,
|
||||
HttpErrIdDbFailure,
|
||||
"Failed to get account from db",
|
||||
http.StatusInternalServerError,
|
||||
)
|
||||
return
|
||||
}
|
||||
// allRoles, err := store.FindRolesByNames(acc.Roles)
|
||||
// collapsedRole := storage.CollapseRolesIntoOne(allRoles...)
|
||||
|
||||
// TODO: Start job of sending out deletion messages to all federated servers
|
||||
|
||||
// Clean up related data first
|
||||
// User role
|
||||
// Custom fields
|
||||
_ = acc
|
||||
store.DeleteAccount(actorId)
|
||||
}
|
||||
|
||||
func linstromIsFollowingAccount(w http.ResponseWriter, r *http.Request) {}
|
||||
func linstromFollowAccount(w http.ResponseWriter, r *http.Request) {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue