mirror of
https://github.com/LemmyNet/lemmy.git
synced 2025-02-02 23:31:41 +00:00
fixed?
This commit is contained in:
parent
a45fcc5665
commit
4b3f2f59ba
2 changed files with 11 additions and 0 deletions
|
@ -128,6 +128,7 @@ test.only("Purge user, uploaded image removed", async () => {
|
|||
};
|
||||
const delete_ = await alphaImage.purgePerson(purgeForm);
|
||||
expect(delete_.success).toBe(true);
|
||||
console.log(upload.image_url + " should be purged");
|
||||
|
||||
// ensure that image is deleted
|
||||
const response2 = await fetch(upload.image_url ?? "");
|
||||
|
|
|
@ -327,6 +327,11 @@ pub async fn purge_image_from_pictrs(image_url: &Url, context: &LemmyContext) ->
|
|||
.next_back()
|
||||
.ok_or(LemmyErrorType::ImageUrlMissingLastPathSegment)?;
|
||||
|
||||
// Delete db row if any (old Lemmy versions didnt generate this).
|
||||
LocalImage::delete_by_alias(&mut context.pool(), &alias)
|
||||
.await
|
||||
.ok();
|
||||
|
||||
let pictrs_config = context.settings().pictrs()?;
|
||||
let purge_url = format!("{}internal/purge?alias={}", pictrs_config.url, alias);
|
||||
|
||||
|
@ -355,6 +360,11 @@ pub async fn delete_image_from_pictrs(
|
|||
delete_token: &str,
|
||||
context: &LemmyContext,
|
||||
) -> LemmyResult<()> {
|
||||
// Delete db row if any (old Lemmy versions didnt generate this).
|
||||
LocalImage::delete_by_alias(&mut context.pool(), &alias)
|
||||
.await
|
||||
.ok();
|
||||
|
||||
let pictrs_config = context.settings().pictrs()?;
|
||||
let url = format!(
|
||||
"{}image/delete/{}/{}",
|
||||
|
|
Loading…
Reference in a new issue