mirror of
https://github.com/LemmyNet/lemmy.git
synced 2025-02-03 07:41:39 +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);
|
const delete_ = await alphaImage.purgePerson(purgeForm);
|
||||||
expect(delete_.success).toBe(true);
|
expect(delete_.success).toBe(true);
|
||||||
|
console.log(upload.image_url + " should be purged");
|
||||||
|
|
||||||
// ensure that image is deleted
|
// ensure that image is deleted
|
||||||
const response2 = await fetch(upload.image_url ?? "");
|
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()
|
.next_back()
|
||||||
.ok_or(LemmyErrorType::ImageUrlMissingLastPathSegment)?;
|
.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 pictrs_config = context.settings().pictrs()?;
|
||||||
let purge_url = format!("{}internal/purge?alias={}", pictrs_config.url, alias);
|
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,
|
delete_token: &str,
|
||||||
context: &LemmyContext,
|
context: &LemmyContext,
|
||||||
) -> LemmyResult<()> {
|
) -> 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 pictrs_config = context.settings().pictrs()?;
|
||||||
let url = format!(
|
let url = format!(
|
||||||
"{}image/delete/{}/{}",
|
"{}image/delete/{}/{}",
|
||||||
|
|
Loading…
Reference in a new issue